diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py index 3b1fa573cedef..7189cd6f50c16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py @@ -46,7 +46,7 @@ class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-06-01' + DEFAULT_API_VERSION = '2020-07-01' _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -114,6 +114,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-04-01: :mod:`v2020_04_01.models` * 2020-05-01: :mod:`v2020_05_01.models` * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-07-01: :mod:`v2020_07_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -205,6 +206,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-06-01': from .v2020_06_01 import models return models + elif api_version == '2020-07-01': + from .v2020_07_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -213,12 +217,15 @@ def application_gateway_private_endpoint_connections(self): * 2020-05-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` * 2020-06-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` + * 2020-07-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('application_gateway_private_endpoint_connections') if api_version == '2020-05-01': from .v2020_05_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_gateway_private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -229,12 +236,15 @@ def application_gateway_private_link_resources(self): * 2020-05-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` * 2020-06-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` + * 2020-07-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` """ api_version = self._get_api_version('application_gateway_private_link_resources') if api_version == '2020-05-01': from .v2020_05_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_gateway_private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -273,6 +283,7 @@ def application_gateways(self): * 2020-04-01: :class:`ApplicationGatewaysOperations` * 2020-05-01: :class:`ApplicationGatewaysOperations` * 2020-06-01: :class:`ApplicationGatewaysOperations` + * 2020-07-01: :class:`ApplicationGatewaysOperations` """ api_version = self._get_api_version('application_gateways') if api_version == '2015-06-15': @@ -335,6 +346,8 @@ def application_gateways(self): from .v2020_05_01.operations import ApplicationGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ApplicationGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -367,6 +380,7 @@ def application_security_groups(self): * 2020-04-01: :class:`ApplicationSecurityGroupsOperations` * 2020-05-01: :class:`ApplicationSecurityGroupsOperations` * 2020-06-01: :class:`ApplicationSecurityGroupsOperations` + * 2020-07-01: :class:`ApplicationSecurityGroupsOperations` """ api_version = self._get_api_version('application_security_groups') if api_version == '2017-09-01': @@ -417,6 +431,8 @@ def application_security_groups(self): from .v2020_05_01.operations import ApplicationSecurityGroupsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ApplicationSecurityGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_security_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -441,6 +457,7 @@ def available_delegations(self): * 2020-04-01: :class:`AvailableDelegationsOperations` * 2020-05-01: :class:`AvailableDelegationsOperations` * 2020-06-01: :class:`AvailableDelegationsOperations` + * 2020-07-01: :class:`AvailableDelegationsOperations` """ api_version = self._get_api_version('available_delegations') if api_version == '2018-08-01': @@ -475,6 +492,8 @@ def available_delegations(self): from .v2020_05_01.operations import AvailableDelegationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AvailableDelegationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_delegations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -509,6 +528,7 @@ def available_endpoint_services(self): * 2020-04-01: :class:`AvailableEndpointServicesOperations` * 2020-05-01: :class:`AvailableEndpointServicesOperations` * 2020-06-01: :class:`AvailableEndpointServicesOperations` + * 2020-07-01: :class:`AvailableEndpointServicesOperations` """ api_version = self._get_api_version('available_endpoint_services') if api_version == '2017-06-01': @@ -563,6 +583,8 @@ def available_endpoint_services(self): from .v2020_05_01.operations import AvailableEndpointServicesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AvailableEndpointServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_endpoint_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -582,6 +604,7 @@ def available_private_endpoint_types(self): * 2020-04-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-05-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-06-01: :class:`AvailablePrivateEndpointTypesOperations` + * 2020-07-01: :class:`AvailablePrivateEndpointTypesOperations` """ api_version = self._get_api_version('available_private_endpoint_types') if api_version == '2019-04-01': @@ -606,6 +629,8 @@ def available_private_endpoint_types(self): from .v2020_05_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_private_endpoint_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -630,6 +655,7 @@ def available_resource_group_delegations(self): * 2020-04-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-05-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-06-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2020-07-01: :class:`AvailableResourceGroupDelegationsOperations` """ api_version = self._get_api_version('available_resource_group_delegations') if api_version == '2018-08-01': @@ -664,6 +690,8 @@ def available_resource_group_delegations(self): from .v2020_05_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_resource_group_delegations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -680,6 +708,7 @@ def available_service_aliases(self): * 2020-04-01: :class:`AvailableServiceAliasesOperations` * 2020-05-01: :class:`AvailableServiceAliasesOperations` * 2020-06-01: :class:`AvailableServiceAliasesOperations` + * 2020-07-01: :class:`AvailableServiceAliasesOperations` """ api_version = self._get_api_version('available_service_aliases') if api_version == '2019-08-01': @@ -698,6 +727,8 @@ def available_service_aliases(self): from .v2020_05_01.operations import AvailableServiceAliasesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AvailableServiceAliasesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AvailableServiceAliasesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_service_aliases'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -722,6 +753,7 @@ def azure_firewall_fqdn_tags(self): * 2020-04-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-05-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-06-01: :class:`AzureFirewallFqdnTagsOperations` + * 2020-07-01: :class:`AzureFirewallFqdnTagsOperations` """ api_version = self._get_api_version('azure_firewall_fqdn_tags') if api_version == '2018-08-01': @@ -756,6 +788,8 @@ def azure_firewall_fqdn_tags(self): from .v2020_05_01.operations import AzureFirewallFqdnTagsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AzureFirewallFqdnTagsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'azure_firewall_fqdn_tags'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -783,6 +817,7 @@ def azure_firewalls(self): * 2020-04-01: :class:`AzureFirewallsOperations` * 2020-05-01: :class:`AzureFirewallsOperations` * 2020-06-01: :class:`AzureFirewallsOperations` + * 2020-07-01: :class:`AzureFirewallsOperations` """ api_version = self._get_api_version('azure_firewalls') if api_version == '2018-04-01': @@ -823,6 +858,8 @@ def azure_firewalls(self): from .v2020_05_01.operations import AzureFirewallsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AzureFirewallsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'azure_firewalls'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -842,6 +879,7 @@ def bastion_hosts(self): * 2020-04-01: :class:`BastionHostsOperations` * 2020-05-01: :class:`BastionHostsOperations` * 2020-06-01: :class:`BastionHostsOperations` + * 2020-07-01: :class:`BastionHostsOperations` """ api_version = self._get_api_version('bastion_hosts') if api_version == '2019-04-01': @@ -866,6 +904,8 @@ def bastion_hosts(self): from .v2020_05_01.operations import BastionHostsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import BastionHostsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import BastionHostsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bastion_hosts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -902,6 +942,7 @@ def bgp_service_communities(self): * 2020-04-01: :class:`BgpServiceCommunitiesOperations` * 2020-05-01: :class:`BgpServiceCommunitiesOperations` * 2020-06-01: :class:`BgpServiceCommunitiesOperations` + * 2020-07-01: :class:`BgpServiceCommunitiesOperations` """ api_version = self._get_api_version('bgp_service_communities') if api_version == '2016-12-01': @@ -960,6 +1001,8 @@ def bgp_service_communities(self): from .v2020_05_01.operations import BgpServiceCommunitiesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import BgpServiceCommunitiesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bgp_service_communities'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -991,6 +1034,7 @@ def connection_monitors(self): * 2020-04-01: :class:`ConnectionMonitorsOperations` * 2020-05-01: :class:`ConnectionMonitorsOperations` * 2020-06-01: :class:`ConnectionMonitorsOperations` + * 2020-07-01: :class:`ConnectionMonitorsOperations` """ api_version = self._get_api_version('connection_monitors') if api_version == '2017-10-01': @@ -1039,6 +1083,8 @@ def connection_monitors(self): from .v2020_05_01.operations import ConnectionMonitorsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ConnectionMonitorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'connection_monitors'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1048,10 +1094,13 @@ def custom_ip_prefixes(self): """Instance depends on the API version: * 2020-06-01: :class:`CustomIPPrefixesOperations` + * 2020-07-01: :class:`CustomIPPrefixesOperations` """ api_version = self._get_api_version('custom_ip_prefixes') if api_version == '2020-06-01': from .v2020_06_01.operations import CustomIPPrefixesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import CustomIPPrefixesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'custom_ip_prefixes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1074,6 +1123,7 @@ def ddos_custom_policies(self): * 2020-04-01: :class:`DdosCustomPoliciesOperations` * 2020-05-01: :class:`DdosCustomPoliciesOperations` * 2020-06-01: :class:`DdosCustomPoliciesOperations` + * 2020-07-01: :class:`DdosCustomPoliciesOperations` """ api_version = self._get_api_version('ddos_custom_policies') if api_version == '2018-11-01': @@ -1104,6 +1154,8 @@ def ddos_custom_policies(self): from .v2020_05_01.operations import DdosCustomPoliciesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import DdosCustomPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ddos_custom_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1132,6 +1184,7 @@ def ddos_protection_plans(self): * 2020-04-01: :class:`DdosProtectionPlansOperations` * 2020-05-01: :class:`DdosProtectionPlansOperations` * 2020-06-01: :class:`DdosProtectionPlansOperations` + * 2020-07-01: :class:`DdosProtectionPlansOperations` """ api_version = self._get_api_version('ddos_protection_plans') if api_version == '2018-02-01': @@ -1174,6 +1227,8 @@ def ddos_protection_plans(self): from .v2020_05_01.operations import DdosProtectionPlansOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import DdosProtectionPlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ddos_protection_plans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1208,6 +1263,7 @@ def default_security_rules(self): * 2020-04-01: :class:`DefaultSecurityRulesOperations` * 2020-05-01: :class:`DefaultSecurityRulesOperations` * 2020-06-01: :class:`DefaultSecurityRulesOperations` + * 2020-07-01: :class:`DefaultSecurityRulesOperations` """ api_version = self._get_api_version('default_security_rules') if api_version == '2017-06-01': @@ -1262,6 +1318,8 @@ def default_security_rules(self): from .v2020_05_01.operations import DefaultSecurityRulesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import DefaultSecurityRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'default_security_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1271,10 +1329,13 @@ def dscp_configuration(self): """Instance depends on the API version: * 2020-06-01: :class:`DscpConfigurationOperations` + * 2020-07-01: :class:`DscpConfigurationOperations` """ api_version = self._get_api_version('dscp_configuration') if api_version == '2020-06-01': from .v2020_06_01.operations import DscpConfigurationOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import DscpConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'dscp_configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1313,6 +1374,7 @@ def express_route_circuit_authorizations(self): * 2020-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-05-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` """ api_version = self._get_api_version('express_route_circuit_authorizations') if api_version == '2015-06-15': @@ -1375,6 +1437,8 @@ def express_route_circuit_authorizations(self): from .v2020_05_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuit_authorizations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1403,6 +1467,7 @@ def express_route_circuit_connections(self): * 2020-04-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-05-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-06-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('express_route_circuit_connections') if api_version == '2018-02-01': @@ -1445,6 +1510,8 @@ def express_route_circuit_connections(self): from .v2020_05_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuit_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1483,6 +1550,7 @@ def express_route_circuit_peerings(self): * 2020-04-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-05-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-06-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitPeeringsOperations` """ api_version = self._get_api_version('express_route_circuit_peerings') if api_version == '2015-06-15': @@ -1545,6 +1613,8 @@ def express_route_circuit_peerings(self): from .v2020_05_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuit_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1583,6 +1653,7 @@ def express_route_circuits(self): * 2020-04-01: :class:`ExpressRouteCircuitsOperations` * 2020-05-01: :class:`ExpressRouteCircuitsOperations` * 2020-06-01: :class:`ExpressRouteCircuitsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitsOperations` """ api_version = self._get_api_version('express_route_circuits') if api_version == '2015-06-15': @@ -1645,6 +1716,8 @@ def express_route_circuits(self): from .v2020_05_01.operations import ExpressRouteCircuitsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteCircuitsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuits'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1669,6 +1742,7 @@ def express_route_connections(self): * 2020-04-01: :class:`ExpressRouteConnectionsOperations` * 2020-05-01: :class:`ExpressRouteConnectionsOperations` * 2020-06-01: :class:`ExpressRouteConnectionsOperations` + * 2020-07-01: :class:`ExpressRouteConnectionsOperations` """ api_version = self._get_api_version('express_route_connections') if api_version == '2018-08-01': @@ -1703,6 +1777,8 @@ def express_route_connections(self): from .v2020_05_01.operations import ExpressRouteConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1731,6 +1807,7 @@ def express_route_cross_connection_peerings(self): * 2020-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-05-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2020-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` """ api_version = self._get_api_version('express_route_cross_connection_peerings') if api_version == '2018-02-01': @@ -1773,6 +1850,8 @@ def express_route_cross_connection_peerings(self): from .v2020_05_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_cross_connection_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1801,6 +1880,7 @@ def express_route_cross_connections(self): * 2020-04-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-05-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-06-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2020-07-01: :class:`ExpressRouteCrossConnectionsOperations` """ api_version = self._get_api_version('express_route_cross_connections') if api_version == '2018-02-01': @@ -1843,6 +1923,8 @@ def express_route_cross_connections(self): from .v2020_05_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_cross_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1867,6 +1949,7 @@ def express_route_gateways(self): * 2020-04-01: :class:`ExpressRouteGatewaysOperations` * 2020-05-01: :class:`ExpressRouteGatewaysOperations` * 2020-06-01: :class:`ExpressRouteGatewaysOperations` + * 2020-07-01: :class:`ExpressRouteGatewaysOperations` """ api_version = self._get_api_version('express_route_gateways') if api_version == '2018-08-01': @@ -1901,6 +1984,8 @@ def express_route_gateways(self): from .v2020_05_01.operations import ExpressRouteGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1925,6 +2010,7 @@ def express_route_links(self): * 2020-04-01: :class:`ExpressRouteLinksOperations` * 2020-05-01: :class:`ExpressRouteLinksOperations` * 2020-06-01: :class:`ExpressRouteLinksOperations` + * 2020-07-01: :class:`ExpressRouteLinksOperations` """ api_version = self._get_api_version('express_route_links') if api_version == '2018-08-01': @@ -1959,6 +2045,8 @@ def express_route_links(self): from .v2020_05_01.operations import ExpressRouteLinksOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1983,6 +2071,7 @@ def express_route_ports(self): * 2020-04-01: :class:`ExpressRoutePortsOperations` * 2020-05-01: :class:`ExpressRoutePortsOperations` * 2020-06-01: :class:`ExpressRoutePortsOperations` + * 2020-07-01: :class:`ExpressRoutePortsOperations` """ api_version = self._get_api_version('express_route_ports') if api_version == '2018-08-01': @@ -2017,6 +2106,8 @@ def express_route_ports(self): from .v2020_05_01.operations import ExpressRoutePortsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRoutePortsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_ports'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2041,6 +2132,7 @@ def express_route_ports_locations(self): * 2020-04-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-05-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-06-01: :class:`ExpressRoutePortsLocationsOperations` + * 2020-07-01: :class:`ExpressRoutePortsLocationsOperations` """ api_version = self._get_api_version('express_route_ports_locations') if api_version == '2018-08-01': @@ -2075,6 +2167,8 @@ def express_route_ports_locations(self): from .v2020_05_01.operations import ExpressRoutePortsLocationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRoutePortsLocationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_ports_locations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2113,6 +2207,7 @@ def express_route_service_providers(self): * 2020-04-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-05-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-06-01: :class:`ExpressRouteServiceProvidersOperations` + * 2020-07-01: :class:`ExpressRouteServiceProvidersOperations` """ api_version = self._get_api_version('express_route_service_providers') if api_version == '2015-06-15': @@ -2175,6 +2270,8 @@ def express_route_service_providers(self): from .v2020_05_01.operations import ExpressRouteServiceProvidersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ExpressRouteServiceProvidersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_service_providers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2193,6 +2290,7 @@ def firewall_policies(self): * 2020-04-01: :class:`FirewallPoliciesOperations` * 2020-05-01: :class:`FirewallPoliciesOperations` * 2020-06-01: :class:`FirewallPoliciesOperations` + * 2020-07-01: :class:`FirewallPoliciesOperations` """ api_version = self._get_api_version('firewall_policies') if api_version == '2019-06-01': @@ -2215,6 +2313,8 @@ def firewall_policies(self): from .v2020_05_01.operations import FirewallPoliciesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import FirewallPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import FirewallPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'firewall_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2225,12 +2325,15 @@ def firewall_policy_rule_collection_groups(self): * 2020-05-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` * 2020-06-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` + * 2020-07-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` """ api_version = self._get_api_version('firewall_policy_rule_collection_groups') if api_version == '2020-05-01': from .v2020_05_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'firewall_policy_rule_collection_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2279,6 +2382,7 @@ def flow_logs(self): * 2020-04-01: :class:`FlowLogsOperations` * 2020-05-01: :class:`FlowLogsOperations` * 2020-06-01: :class:`FlowLogsOperations` + * 2020-07-01: :class:`FlowLogsOperations` """ api_version = self._get_api_version('flow_logs') if api_version == '2019-11-01': @@ -2293,6 +2397,8 @@ def flow_logs(self): from .v2020_05_01.operations import FlowLogsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import FlowLogsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import FlowLogsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'flow_logs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2304,6 +2410,7 @@ def hub_route_tables(self): * 2020-04-01: :class:`HubRouteTablesOperations` * 2020-05-01: :class:`HubRouteTablesOperations` * 2020-06-01: :class:`HubRouteTablesOperations` + * 2020-07-01: :class:`HubRouteTablesOperations` """ api_version = self._get_api_version('hub_route_tables') if api_version == '2020-04-01': @@ -2312,6 +2419,8 @@ def hub_route_tables(self): from .v2020_05_01.operations import HubRouteTablesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import HubRouteTablesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import HubRouteTablesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'hub_route_tables'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2339,6 +2448,7 @@ def hub_virtual_network_connections(self): * 2020-04-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-05-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-06-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2020-07-01: :class:`HubVirtualNetworkConnectionsOperations` """ api_version = self._get_api_version('hub_virtual_network_connections') if api_version == '2018-04-01': @@ -2379,6 +2489,8 @@ def hub_virtual_network_connections(self): from .v2020_05_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'hub_virtual_network_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2413,6 +2525,7 @@ def inbound_nat_rules(self): * 2020-04-01: :class:`InboundNatRulesOperations` * 2020-05-01: :class:`InboundNatRulesOperations` * 2020-06-01: :class:`InboundNatRulesOperations` + * 2020-07-01: :class:`InboundNatRulesOperations` """ api_version = self._get_api_version('inbound_nat_rules') if api_version == '2017-06-01': @@ -2467,6 +2580,8 @@ def inbound_nat_rules(self): from .v2020_05_01.operations import InboundNatRulesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import InboundNatRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'inbound_nat_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2476,10 +2591,13 @@ def inbound_security_rule(self): """Instance depends on the API version: * 2020-06-01: :class:`InboundSecurityRuleOperations` + * 2020-07-01: :class:`InboundSecurityRuleOperations` """ api_version = self._get_api_version('inbound_security_rule') if api_version == '2020-06-01': from .v2020_06_01.operations import InboundSecurityRuleOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import InboundSecurityRuleOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'inbound_security_rule'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2517,6 +2635,7 @@ def ip_allocations(self): * 2020-04-01: :class:`IpAllocationsOperations` * 2020-05-01: :class:`IpAllocationsOperations` * 2020-06-01: :class:`IpAllocationsOperations` + * 2020-07-01: :class:`IpAllocationsOperations` """ api_version = self._get_api_version('ip_allocations') if api_version == '2020-03-01': @@ -2527,6 +2646,8 @@ def ip_allocations(self): from .v2020_05_01.operations import IpAllocationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import IpAllocationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import IpAllocationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ip_allocations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2542,6 +2663,7 @@ def ip_groups(self): * 2020-04-01: :class:`IpGroupsOperations` * 2020-05-01: :class:`IpGroupsOperations` * 2020-06-01: :class:`IpGroupsOperations` + * 2020-07-01: :class:`IpGroupsOperations` """ api_version = self._get_api_version('ip_groups') if api_version == '2019-09-01': @@ -2558,6 +2680,8 @@ def ip_groups(self): from .v2020_05_01.operations import IpGroupsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import IpGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import IpGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ip_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2592,6 +2716,7 @@ def load_balancer_backend_address_pools(self): * 2020-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-05-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2020-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` """ api_version = self._get_api_version('load_balancer_backend_address_pools') if api_version == '2017-06-01': @@ -2646,6 +2771,8 @@ def load_balancer_backend_address_pools(self): from .v2020_05_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_backend_address_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2680,6 +2807,7 @@ def load_balancer_frontend_ip_configurations(self): * 2020-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-05-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2020-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` """ api_version = self._get_api_version('load_balancer_frontend_ip_configurations') if api_version == '2017-06-01': @@ -2734,6 +2862,8 @@ def load_balancer_frontend_ip_configurations(self): from .v2020_05_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_frontend_ip_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2768,6 +2898,7 @@ def load_balancer_load_balancing_rules(self): * 2020-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-05-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2020-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` """ api_version = self._get_api_version('load_balancer_load_balancing_rules') if api_version == '2017-06-01': @@ -2822,6 +2953,8 @@ def load_balancer_load_balancing_rules(self): from .v2020_05_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_load_balancing_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2856,6 +2989,7 @@ def load_balancer_network_interfaces(self): * 2020-04-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-05-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-06-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2020-07-01: :class:`LoadBalancerNetworkInterfacesOperations` """ api_version = self._get_api_version('load_balancer_network_interfaces') if api_version == '2017-06-01': @@ -2910,6 +3044,8 @@ def load_balancer_network_interfaces(self): from .v2020_05_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_network_interfaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2934,6 +3070,7 @@ def load_balancer_outbound_rules(self): * 2020-04-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-05-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-06-01: :class:`LoadBalancerOutboundRulesOperations` + * 2020-07-01: :class:`LoadBalancerOutboundRulesOperations` """ api_version = self._get_api_version('load_balancer_outbound_rules') if api_version == '2018-08-01': @@ -2968,6 +3105,8 @@ def load_balancer_outbound_rules(self): from .v2020_05_01.operations import LoadBalancerOutboundRulesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancerOutboundRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_outbound_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3002,6 +3141,7 @@ def load_balancer_probes(self): * 2020-04-01: :class:`LoadBalancerProbesOperations` * 2020-05-01: :class:`LoadBalancerProbesOperations` * 2020-06-01: :class:`LoadBalancerProbesOperations` + * 2020-07-01: :class:`LoadBalancerProbesOperations` """ api_version = self._get_api_version('load_balancer_probes') if api_version == '2017-06-01': @@ -3056,6 +3196,8 @@ def load_balancer_probes(self): from .v2020_05_01.operations import LoadBalancerProbesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancerProbesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_probes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3094,6 +3236,7 @@ def load_balancers(self): * 2020-04-01: :class:`LoadBalancersOperations` * 2020-05-01: :class:`LoadBalancersOperations` * 2020-06-01: :class:`LoadBalancersOperations` + * 2020-07-01: :class:`LoadBalancersOperations` """ api_version = self._get_api_version('load_balancers') if api_version == '2015-06-15': @@ -3156,6 +3299,8 @@ def load_balancers(self): from .v2020_05_01.operations import LoadBalancersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LoadBalancersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3194,6 +3339,7 @@ def local_network_gateways(self): * 2020-04-01: :class:`LocalNetworkGatewaysOperations` * 2020-05-01: :class:`LocalNetworkGatewaysOperations` * 2020-06-01: :class:`LocalNetworkGatewaysOperations` + * 2020-07-01: :class:`LocalNetworkGatewaysOperations` """ api_version = self._get_api_version('local_network_gateways') if api_version == '2015-06-15': @@ -3256,6 +3402,8 @@ def local_network_gateways(self): from .v2020_05_01.operations import LocalNetworkGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import LocalNetworkGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'local_network_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3276,6 +3424,7 @@ def nat_gateways(self): * 2020-04-01: :class:`NatGatewaysOperations` * 2020-05-01: :class:`NatGatewaysOperations` * 2020-06-01: :class:`NatGatewaysOperations` + * 2020-07-01: :class:`NatGatewaysOperations` """ api_version = self._get_api_version('nat_gateways') if api_version == '2019-02-01': @@ -3302,6 +3451,8 @@ def nat_gateways(self): from .v2020_05_01.operations import NatGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NatGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NatGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'nat_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3336,6 +3487,7 @@ def network_interface_ip_configurations(self): * 2020-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-05-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2020-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` """ api_version = self._get_api_version('network_interface_ip_configurations') if api_version == '2017-06-01': @@ -3390,6 +3542,8 @@ def network_interface_ip_configurations(self): from .v2020_05_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interface_ip_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3424,6 +3578,7 @@ def network_interface_load_balancers(self): * 2020-04-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-05-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-06-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2020-07-01: :class:`NetworkInterfaceLoadBalancersOperations` """ api_version = self._get_api_version('network_interface_load_balancers') if api_version == '2017-06-01': @@ -3478,6 +3633,8 @@ def network_interface_load_balancers(self): from .v2020_05_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interface_load_balancers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3502,6 +3659,7 @@ def network_interface_tap_configurations(self): * 2020-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-05-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-06-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2020-07-01: :class:`NetworkInterfaceTapConfigurationsOperations` """ api_version = self._get_api_version('network_interface_tap_configurations') if api_version == '2018-08-01': @@ -3536,6 +3694,8 @@ def network_interface_tap_configurations(self): from .v2020_05_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interface_tap_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3574,6 +3734,7 @@ def network_interfaces(self): * 2020-04-01: :class:`NetworkInterfacesOperations` * 2020-05-01: :class:`NetworkInterfacesOperations` * 2020-06-01: :class:`NetworkInterfacesOperations` + * 2020-07-01: :class:`NetworkInterfacesOperations` """ api_version = self._get_api_version('network_interfaces') if api_version == '2015-06-15': @@ -3636,6 +3797,8 @@ def network_interfaces(self): from .v2020_05_01.operations import NetworkInterfacesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkInterfacesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interfaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3660,6 +3823,7 @@ def network_profiles(self): * 2020-04-01: :class:`NetworkProfilesOperations` * 2020-05-01: :class:`NetworkProfilesOperations` * 2020-06-01: :class:`NetworkProfilesOperations` + * 2020-07-01: :class:`NetworkProfilesOperations` """ api_version = self._get_api_version('network_profiles') if api_version == '2018-08-01': @@ -3694,6 +3858,8 @@ def network_profiles(self): from .v2020_05_01.operations import NetworkProfilesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkProfilesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_profiles'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3732,6 +3898,7 @@ def network_security_groups(self): * 2020-04-01: :class:`NetworkSecurityGroupsOperations` * 2020-05-01: :class:`NetworkSecurityGroupsOperations` * 2020-06-01: :class:`NetworkSecurityGroupsOperations` + * 2020-07-01: :class:`NetworkSecurityGroupsOperations` """ api_version = self._get_api_version('network_security_groups') if api_version == '2015-06-15': @@ -3794,6 +3961,8 @@ def network_security_groups(self): from .v2020_05_01.operations import NetworkSecurityGroupsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkSecurityGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_security_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3807,6 +3976,7 @@ def network_virtual_appliances(self): * 2020-04-01: :class:`NetworkVirtualAppliancesOperations` * 2020-05-01: :class:`NetworkVirtualAppliancesOperations` * 2020-06-01: :class:`NetworkVirtualAppliancesOperations` + * 2020-07-01: :class:`NetworkVirtualAppliancesOperations` """ api_version = self._get_api_version('network_virtual_appliances') if api_version == '2019-12-01': @@ -3819,6 +3989,8 @@ def network_virtual_appliances(self): from .v2020_05_01.operations import NetworkVirtualAppliancesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkVirtualAppliancesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkVirtualAppliancesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_virtual_appliances'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3856,6 +4028,7 @@ def network_watchers(self): * 2020-04-01: :class:`NetworkWatchersOperations` * 2020-05-01: :class:`NetworkWatchersOperations` * 2020-06-01: :class:`NetworkWatchersOperations` + * 2020-07-01: :class:`NetworkWatchersOperations` """ api_version = self._get_api_version('network_watchers') if api_version == '2016-09-01': @@ -3916,6 +4089,8 @@ def network_watchers(self): from .v2020_05_01.operations import NetworkWatchersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkWatchersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_watchers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3948,6 +4123,7 @@ def operations(self): * 2020-04-01: :class:`Operations` * 2020-05-01: :class:`Operations` * 2020-06-01: :class:`Operations` + * 2020-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-09-01': @@ -3998,6 +4174,8 @@ def operations(self): from .v2020_05_01.operations import Operations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import Operations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4022,6 +4200,7 @@ def p2_svpn_gateways(self): * 2020-04-01: :class:`P2SVpnGatewaysOperations` * 2020-05-01: :class:`P2SVpnGatewaysOperations` * 2020-06-01: :class:`P2SVpnGatewaysOperations` + * 2020-07-01: :class:`P2SVpnGatewaysOperations` """ api_version = self._get_api_version('p2_svpn_gateways') if api_version == '2018-08-01': @@ -4056,6 +4235,8 @@ def p2_svpn_gateways(self): from .v2020_05_01.operations import P2SVpnGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import P2SVpnGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import P2SVpnGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'p2_svpn_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4127,6 +4308,7 @@ def packet_captures(self): * 2020-04-01: :class:`PacketCapturesOperations` * 2020-05-01: :class:`PacketCapturesOperations` * 2020-06-01: :class:`PacketCapturesOperations` + * 2020-07-01: :class:`PacketCapturesOperations` """ api_version = self._get_api_version('packet_captures') if api_version == '2016-09-01': @@ -4187,6 +4369,8 @@ def packet_captures(self): from .v2020_05_01.operations import PacketCapturesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PacketCapturesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'packet_captures'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4208,6 +4392,7 @@ def peer_express_route_circuit_connections(self): * 2020-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-05-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-06-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2020-07-01: :class:`PeerExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('peer_express_route_circuit_connections') if api_version == '2018-12-01': @@ -4236,6 +4421,8 @@ def peer_express_route_circuit_connections(self): from .v2020_05_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'peer_express_route_circuit_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4248,6 +4435,7 @@ def private_dns_zone_groups(self): * 2020-04-01: :class:`PrivateDnsZoneGroupsOperations` * 2020-05-01: :class:`PrivateDnsZoneGroupsOperations` * 2020-06-01: :class:`PrivateDnsZoneGroupsOperations` + * 2020-07-01: :class:`PrivateDnsZoneGroupsOperations` """ api_version = self._get_api_version('private_dns_zone_groups') if api_version == '2020-03-01': @@ -4258,6 +4446,8 @@ def private_dns_zone_groups(self): from .v2020_05_01.operations import PrivateDnsZoneGroupsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PrivateDnsZoneGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PrivateDnsZoneGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_dns_zone_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4277,6 +4467,7 @@ def private_endpoints(self): * 2020-04-01: :class:`PrivateEndpointsOperations` * 2020-05-01: :class:`PrivateEndpointsOperations` * 2020-06-01: :class:`PrivateEndpointsOperations` + * 2020-07-01: :class:`PrivateEndpointsOperations` """ api_version = self._get_api_version('private_endpoints') if api_version == '2019-04-01': @@ -4301,6 +4492,8 @@ def private_endpoints(self): from .v2020_05_01.operations import PrivateEndpointsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PrivateEndpointsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PrivateEndpointsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoints'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4320,6 +4513,7 @@ def private_link_services(self): * 2020-04-01: :class:`PrivateLinkServicesOperations` * 2020-05-01: :class:`PrivateLinkServicesOperations` * 2020-06-01: :class:`PrivateLinkServicesOperations` + * 2020-07-01: :class:`PrivateLinkServicesOperations` """ api_version = self._get_api_version('private_link_services') if api_version == '2019-04-01': @@ -4344,6 +4538,8 @@ def private_link_services(self): from .v2020_05_01.operations import PrivateLinkServicesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PrivateLinkServicesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PrivateLinkServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4382,6 +4578,7 @@ def public_ip_addresses(self): * 2020-04-01: :class:`PublicIPAddressesOperations` * 2020-05-01: :class:`PublicIPAddressesOperations` * 2020-06-01: :class:`PublicIPAddressesOperations` + * 2020-07-01: :class:`PublicIPAddressesOperations` """ api_version = self._get_api_version('public_ip_addresses') if api_version == '2015-06-15': @@ -4444,6 +4641,8 @@ def public_ip_addresses(self): from .v2020_05_01.operations import PublicIPAddressesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PublicIPAddressesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'public_ip_addresses'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4469,6 +4668,7 @@ def public_ip_prefixes(self): * 2020-04-01: :class:`PublicIPPrefixesOperations` * 2020-05-01: :class:`PublicIPPrefixesOperations` * 2020-06-01: :class:`PublicIPPrefixesOperations` + * 2020-07-01: :class:`PublicIPPrefixesOperations` """ api_version = self._get_api_version('public_ip_prefixes') if api_version == '2018-07-01': @@ -4505,6 +4705,8 @@ def public_ip_prefixes(self): from .v2020_05_01.operations import PublicIPPrefixesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PublicIPPrefixesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'public_ip_prefixes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4525,6 +4727,7 @@ def resource_navigation_links(self): * 2020-04-01: :class:`ResourceNavigationLinksOperations` * 2020-05-01: :class:`ResourceNavigationLinksOperations` * 2020-06-01: :class:`ResourceNavigationLinksOperations` + * 2020-07-01: :class:`ResourceNavigationLinksOperations` """ api_version = self._get_api_version('resource_navigation_links') if api_version == '2019-02-01': @@ -4551,6 +4754,8 @@ def resource_navigation_links(self): from .v2020_05_01.operations import ResourceNavigationLinksOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ResourceNavigationLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resource_navigation_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4587,6 +4792,7 @@ def route_filter_rules(self): * 2020-04-01: :class:`RouteFilterRulesOperations` * 2020-05-01: :class:`RouteFilterRulesOperations` * 2020-06-01: :class:`RouteFilterRulesOperations` + * 2020-07-01: :class:`RouteFilterRulesOperations` """ api_version = self._get_api_version('route_filter_rules') if api_version == '2016-12-01': @@ -4645,6 +4851,8 @@ def route_filter_rules(self): from .v2020_05_01.operations import RouteFilterRulesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import RouteFilterRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'route_filter_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4681,6 +4889,7 @@ def route_filters(self): * 2020-04-01: :class:`RouteFiltersOperations` * 2020-05-01: :class:`RouteFiltersOperations` * 2020-06-01: :class:`RouteFiltersOperations` + * 2020-07-01: :class:`RouteFiltersOperations` """ api_version = self._get_api_version('route_filters') if api_version == '2016-12-01': @@ -4739,6 +4948,8 @@ def route_filters(self): from .v2020_05_01.operations import RouteFiltersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import RouteFiltersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'route_filters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4777,6 +4988,7 @@ def route_tables(self): * 2020-04-01: :class:`RouteTablesOperations` * 2020-05-01: :class:`RouteTablesOperations` * 2020-06-01: :class:`RouteTablesOperations` + * 2020-07-01: :class:`RouteTablesOperations` """ api_version = self._get_api_version('route_tables') if api_version == '2015-06-15': @@ -4839,6 +5051,8 @@ def route_tables(self): from .v2020_05_01.operations import RouteTablesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import RouteTablesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'route_tables'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4877,6 +5091,7 @@ def routes(self): * 2020-04-01: :class:`RoutesOperations` * 2020-05-01: :class:`RoutesOperations` * 2020-06-01: :class:`RoutesOperations` + * 2020-07-01: :class:`RoutesOperations` """ api_version = self._get_api_version('routes') if api_version == '2015-06-15': @@ -4939,6 +5154,8 @@ def routes(self): from .v2020_05_01.operations import RoutesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import RoutesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import RoutesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'routes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4951,6 +5168,7 @@ def security_partner_providers(self): * 2020-04-01: :class:`SecurityPartnerProvidersOperations` * 2020-05-01: :class:`SecurityPartnerProvidersOperations` * 2020-06-01: :class:`SecurityPartnerProvidersOperations` + * 2020-07-01: :class:`SecurityPartnerProvidersOperations` """ api_version = self._get_api_version('security_partner_providers') if api_version == '2020-03-01': @@ -4961,6 +5179,8 @@ def security_partner_providers(self): from .v2020_05_01.operations import SecurityPartnerProvidersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import SecurityPartnerProvidersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import SecurityPartnerProvidersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'security_partner_providers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4999,6 +5219,7 @@ def security_rules(self): * 2020-04-01: :class:`SecurityRulesOperations` * 2020-05-01: :class:`SecurityRulesOperations` * 2020-06-01: :class:`SecurityRulesOperations` + * 2020-07-01: :class:`SecurityRulesOperations` """ api_version = self._get_api_version('security_rules') if api_version == '2015-06-15': @@ -5061,6 +5282,8 @@ def security_rules(self): from .v2020_05_01.operations import SecurityRulesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import SecurityRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'security_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5081,6 +5304,7 @@ def service_association_links(self): * 2020-04-01: :class:`ServiceAssociationLinksOperations` * 2020-05-01: :class:`ServiceAssociationLinksOperations` * 2020-06-01: :class:`ServiceAssociationLinksOperations` + * 2020-07-01: :class:`ServiceAssociationLinksOperations` """ api_version = self._get_api_version('service_association_links') if api_version == '2019-02-01': @@ -5107,6 +5331,8 @@ def service_association_links(self): from .v2020_05_01.operations import ServiceAssociationLinksOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ServiceAssociationLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_association_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5132,6 +5358,7 @@ def service_endpoint_policies(self): * 2020-04-01: :class:`ServiceEndpointPoliciesOperations` * 2020-05-01: :class:`ServiceEndpointPoliciesOperations` * 2020-06-01: :class:`ServiceEndpointPoliciesOperations` + * 2020-07-01: :class:`ServiceEndpointPoliciesOperations` """ api_version = self._get_api_version('service_endpoint_policies') if api_version == '2018-07-01': @@ -5168,6 +5395,8 @@ def service_endpoint_policies(self): from .v2020_05_01.operations import ServiceEndpointPoliciesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ServiceEndpointPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_endpoint_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5193,6 +5422,7 @@ def service_endpoint_policy_definitions(self): * 2020-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-05-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-06-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2020-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` """ api_version = self._get_api_version('service_endpoint_policy_definitions') if api_version == '2018-07-01': @@ -5229,6 +5459,8 @@ def service_endpoint_policy_definitions(self): from .v2020_05_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_endpoint_policy_definitions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5248,6 +5480,7 @@ def service_tags(self): * 2020-04-01: :class:`ServiceTagsOperations` * 2020-05-01: :class:`ServiceTagsOperations` * 2020-06-01: :class:`ServiceTagsOperations` + * 2020-07-01: :class:`ServiceTagsOperations` """ api_version = self._get_api_version('service_tags') if api_version == '2019-04-01': @@ -5272,6 +5505,8 @@ def service_tags(self): from .v2020_05_01.operations import ServiceTagsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import ServiceTagsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ServiceTagsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_tags'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5310,6 +5545,7 @@ def subnets(self): * 2020-04-01: :class:`SubnetsOperations` * 2020-05-01: :class:`SubnetsOperations` * 2020-06-01: :class:`SubnetsOperations` + * 2020-07-01: :class:`SubnetsOperations` """ api_version = self._get_api_version('subnets') if api_version == '2015-06-15': @@ -5372,6 +5608,8 @@ def subnets(self): from .v2020_05_01.operations import SubnetsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import SubnetsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import SubnetsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'subnets'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5410,6 +5648,7 @@ def usages(self): * 2020-04-01: :class:`UsagesOperations` * 2020-05-01: :class:`UsagesOperations` * 2020-06-01: :class:`UsagesOperations` + * 2020-07-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2015-06-15': @@ -5472,6 +5711,8 @@ def usages(self): from .v2020_05_01.operations import UsagesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import UsagesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import UsagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5482,12 +5723,15 @@ def virtual_appliance_sites(self): * 2020-05-01: :class:`VirtualApplianceSitesOperations` * 2020-06-01: :class:`VirtualApplianceSitesOperations` + * 2020-07-01: :class:`VirtualApplianceSitesOperations` """ api_version = self._get_api_version('virtual_appliance_sites') if api_version == '2020-05-01': from .v2020_05_01.operations import VirtualApplianceSitesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualApplianceSitesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualApplianceSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_appliance_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5498,12 +5742,15 @@ def virtual_appliance_skus(self): * 2020-05-01: :class:`VirtualApplianceSkusOperations` * 2020-06-01: :class:`VirtualApplianceSkusOperations` + * 2020-07-01: :class:`VirtualApplianceSkusOperations` """ api_version = self._get_api_version('virtual_appliance_skus') if api_version == '2020-05-01': from .v2020_05_01.operations import VirtualApplianceSkusOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualApplianceSkusOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualApplianceSkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_appliance_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5514,12 +5761,15 @@ def virtual_hub_bgp_connection(self): * 2020-05-01: :class:`VirtualHubBgpConnectionOperations` * 2020-06-01: :class:`VirtualHubBgpConnectionOperations` + * 2020-07-01: :class:`VirtualHubBgpConnectionOperations` """ api_version = self._get_api_version('virtual_hub_bgp_connection') if api_version == '2020-05-01': from .v2020_05_01.operations import VirtualHubBgpConnectionOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualHubBgpConnectionOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualHubBgpConnectionOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_bgp_connection'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5530,12 +5780,15 @@ def virtual_hub_bgp_connections(self): * 2020-05-01: :class:`VirtualHubBgpConnectionsOperations` * 2020-06-01: :class:`VirtualHubBgpConnectionsOperations` + * 2020-07-01: :class:`VirtualHubBgpConnectionsOperations` """ api_version = self._get_api_version('virtual_hub_bgp_connections') if api_version == '2020-05-01': from .v2020_05_01.operations import VirtualHubBgpConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualHubBgpConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualHubBgpConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_bgp_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5546,12 +5799,15 @@ def virtual_hub_ip_configuration(self): * 2020-05-01: :class:`VirtualHubIpConfigurationOperations` * 2020-06-01: :class:`VirtualHubIpConfigurationOperations` + * 2020-07-01: :class:`VirtualHubIpConfigurationOperations` """ api_version = self._get_api_version('virtual_hub_ip_configuration') if api_version == '2020-05-01': from .v2020_05_01.operations import VirtualHubIpConfigurationOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualHubIpConfigurationOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualHubIpConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_ip_configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5567,6 +5823,7 @@ def virtual_hub_route_table_v2_s(self): * 2020-04-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-05-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-06-01: :class:`VirtualHubRouteTableV2SOperations` + * 2020-07-01: :class:`VirtualHubRouteTableV2SOperations` """ api_version = self._get_api_version('virtual_hub_route_table_v2_s') if api_version == '2019-09-01': @@ -5583,6 +5840,8 @@ def virtual_hub_route_table_v2_s(self): from .v2020_05_01.operations import VirtualHubRouteTableV2SOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualHubRouteTableV2SOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualHubRouteTableV2SOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_route_table_v2_s'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5610,6 +5869,7 @@ def virtual_hubs(self): * 2020-04-01: :class:`VirtualHubsOperations` * 2020-05-01: :class:`VirtualHubsOperations` * 2020-06-01: :class:`VirtualHubsOperations` + * 2020-07-01: :class:`VirtualHubsOperations` """ api_version = self._get_api_version('virtual_hubs') if api_version == '2018-04-01': @@ -5650,6 +5910,8 @@ def virtual_hubs(self): from .v2020_05_01.operations import VirtualHubsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualHubsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hubs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5688,6 +5950,7 @@ def virtual_network_gateway_connections(self): * 2020-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-05-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2020-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` """ api_version = self._get_api_version('virtual_network_gateway_connections') if api_version == '2015-06-15': @@ -5750,6 +6013,8 @@ def virtual_network_gateway_connections(self): from .v2020_05_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_gateway_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5788,6 +6053,7 @@ def virtual_network_gateways(self): * 2020-04-01: :class:`VirtualNetworkGatewaysOperations` * 2020-05-01: :class:`VirtualNetworkGatewaysOperations` * 2020-06-01: :class:`VirtualNetworkGatewaysOperations` + * 2020-07-01: :class:`VirtualNetworkGatewaysOperations` """ api_version = self._get_api_version('virtual_network_gateways') if api_version == '2015-06-15': @@ -5850,6 +6116,8 @@ def virtual_network_gateways(self): from .v2020_05_01.operations import VirtualNetworkGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualNetworkGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5887,6 +6155,7 @@ def virtual_network_peerings(self): * 2020-04-01: :class:`VirtualNetworkPeeringsOperations` * 2020-05-01: :class:`VirtualNetworkPeeringsOperations` * 2020-06-01: :class:`VirtualNetworkPeeringsOperations` + * 2020-07-01: :class:`VirtualNetworkPeeringsOperations` """ api_version = self._get_api_version('virtual_network_peerings') if api_version == '2016-09-01': @@ -5947,6 +6216,8 @@ def virtual_network_peerings(self): from .v2020_05_01.operations import VirtualNetworkPeeringsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualNetworkPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5971,6 +6242,7 @@ def virtual_network_taps(self): * 2020-04-01: :class:`VirtualNetworkTapsOperations` * 2020-05-01: :class:`VirtualNetworkTapsOperations` * 2020-06-01: :class:`VirtualNetworkTapsOperations` + * 2020-07-01: :class:`VirtualNetworkTapsOperations` """ api_version = self._get_api_version('virtual_network_taps') if api_version == '2018-08-01': @@ -6005,6 +6277,8 @@ def virtual_network_taps(self): from .v2020_05_01.operations import VirtualNetworkTapsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualNetworkTapsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_taps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6043,6 +6317,7 @@ def virtual_networks(self): * 2020-04-01: :class:`VirtualNetworksOperations` * 2020-05-01: :class:`VirtualNetworksOperations` * 2020-06-01: :class:`VirtualNetworksOperations` + * 2020-07-01: :class:`VirtualNetworksOperations` """ api_version = self._get_api_version('virtual_networks') if api_version == '2015-06-15': @@ -6105,6 +6380,8 @@ def virtual_networks(self): from .v2020_05_01.operations import VirtualNetworksOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualNetworksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_networks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6122,6 +6399,7 @@ def virtual_router_peerings(self): * 2020-04-01: :class:`VirtualRouterPeeringsOperations` * 2020-05-01: :class:`VirtualRouterPeeringsOperations` * 2020-06-01: :class:`VirtualRouterPeeringsOperations` + * 2020-07-01: :class:`VirtualRouterPeeringsOperations` """ api_version = self._get_api_version('virtual_router_peerings') if api_version == '2019-07-01': @@ -6142,6 +6420,8 @@ def virtual_router_peerings(self): from .v2020_05_01.operations import VirtualRouterPeeringsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualRouterPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualRouterPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_router_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6159,6 +6439,7 @@ def virtual_routers(self): * 2020-04-01: :class:`VirtualRoutersOperations` * 2020-05-01: :class:`VirtualRoutersOperations` * 2020-06-01: :class:`VirtualRoutersOperations` + * 2020-07-01: :class:`VirtualRoutersOperations` """ api_version = self._get_api_version('virtual_routers') if api_version == '2019-07-01': @@ -6179,6 +6460,8 @@ def virtual_routers(self): from .v2020_05_01.operations import VirtualRoutersOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualRoutersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualRoutersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_routers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6206,6 +6489,7 @@ def virtual_wans(self): * 2020-04-01: :class:`VirtualWansOperations` * 2020-05-01: :class:`VirtualWansOperations` * 2020-06-01: :class:`VirtualWansOperations` + * 2020-07-01: :class:`VirtualWansOperations` """ api_version = self._get_api_version('virtual_wans') if api_version == '2018-04-01': @@ -6246,6 +6530,8 @@ def virtual_wans(self): from .v2020_05_01.operations import VirtualWansOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VirtualWansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_wans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6273,6 +6559,7 @@ def vpn_connections(self): * 2020-04-01: :class:`VpnConnectionsOperations` * 2020-05-01: :class:`VpnConnectionsOperations` * 2020-06-01: :class:`VpnConnectionsOperations` + * 2020-07-01: :class:`VpnConnectionsOperations` """ api_version = self._get_api_version('vpn_connections') if api_version == '2018-04-01': @@ -6313,6 +6600,8 @@ def vpn_connections(self): from .v2020_05_01.operations import VpnConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6340,6 +6629,7 @@ def vpn_gateways(self): * 2020-04-01: :class:`VpnGatewaysOperations` * 2020-05-01: :class:`VpnGatewaysOperations` * 2020-06-01: :class:`VpnGatewaysOperations` + * 2020-07-01: :class:`VpnGatewaysOperations` """ api_version = self._get_api_version('vpn_gateways') if api_version == '2018-04-01': @@ -6380,6 +6670,8 @@ def vpn_gateways(self): from .v2020_05_01.operations import VpnGatewaysOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6398,6 +6690,7 @@ def vpn_link_connections(self): * 2020-04-01: :class:`VpnLinkConnectionsOperations` * 2020-05-01: :class:`VpnLinkConnectionsOperations` * 2020-06-01: :class:`VpnLinkConnectionsOperations` + * 2020-07-01: :class:`VpnLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_link_connections') if api_version == '2019-06-01': @@ -6420,6 +6713,8 @@ def vpn_link_connections(self): from .v2020_05_01.operations import VpnLinkConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnLinkConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnLinkConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_link_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6436,6 +6731,7 @@ def vpn_server_configurations(self): * 2020-04-01: :class:`VpnServerConfigurationsOperations` * 2020-05-01: :class:`VpnServerConfigurationsOperations` * 2020-06-01: :class:`VpnServerConfigurationsOperations` + * 2020-07-01: :class:`VpnServerConfigurationsOperations` """ api_version = self._get_api_version('vpn_server_configurations') if api_version == '2019-08-01': @@ -6454,6 +6750,8 @@ def vpn_server_configurations(self): from .v2020_05_01.operations import VpnServerConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnServerConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnServerConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_server_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6470,6 +6768,7 @@ def vpn_server_configurations_associated_with_virtual_wan(self): * 2020-04-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-05-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-06-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` + * 2020-07-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` """ api_version = self._get_api_version('vpn_server_configurations_associated_with_virtual_wan') if api_version == '2019-08-01': @@ -6488,6 +6787,8 @@ def vpn_server_configurations_associated_with_virtual_wan(self): from .v2020_05_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_server_configurations_associated_with_virtual_wan'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6506,6 +6807,7 @@ def vpn_site_link_connections(self): * 2020-04-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-05-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-06-01: :class:`VpnSiteLinkConnectionsOperations` + * 2020-07-01: :class:`VpnSiteLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_site_link_connections') if api_version == '2019-06-01': @@ -6528,6 +6830,8 @@ def vpn_site_link_connections(self): from .v2020_05_01.operations import VpnSiteLinkConnectionsOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnSiteLinkConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnSiteLinkConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_site_link_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6546,6 +6850,7 @@ def vpn_site_links(self): * 2020-04-01: :class:`VpnSiteLinksOperations` * 2020-05-01: :class:`VpnSiteLinksOperations` * 2020-06-01: :class:`VpnSiteLinksOperations` + * 2020-07-01: :class:`VpnSiteLinksOperations` """ api_version = self._get_api_version('vpn_site_links') if api_version == '2019-06-01': @@ -6568,6 +6873,8 @@ def vpn_site_links(self): from .v2020_05_01.operations import VpnSiteLinksOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnSiteLinksOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnSiteLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_site_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6595,6 +6902,7 @@ def vpn_sites(self): * 2020-04-01: :class:`VpnSitesOperations` * 2020-05-01: :class:`VpnSitesOperations` * 2020-06-01: :class:`VpnSitesOperations` + * 2020-07-01: :class:`VpnSitesOperations` """ api_version = self._get_api_version('vpn_sites') if api_version == '2018-04-01': @@ -6635,6 +6943,8 @@ def vpn_sites(self): from .v2020_05_01.operations import VpnSitesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6662,6 +6972,7 @@ def vpn_sites_configuration(self): * 2020-04-01: :class:`VpnSitesConfigurationOperations` * 2020-05-01: :class:`VpnSitesConfigurationOperations` * 2020-06-01: :class:`VpnSitesConfigurationOperations` + * 2020-07-01: :class:`VpnSitesConfigurationOperations` """ api_version = self._get_api_version('vpn_sites_configuration') if api_version == '2018-04-01': @@ -6702,6 +7013,8 @@ def vpn_sites_configuration(self): from .v2020_05_01.operations import VpnSitesConfigurationOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import VpnSitesConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_sites_configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6723,6 +7036,7 @@ def web_application_firewall_policies(self): * 2020-04-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-05-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-06-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2020-07-01: :class:`WebApplicationFirewallPoliciesOperations` """ api_version = self._get_api_version('web_application_firewall_policies') if api_version == '2018-12-01': @@ -6751,10 +7065,25 @@ def web_application_firewall_policies(self): from .v2020_05_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_application_firewall_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def web_categories(self): + """Instance depends on the API version: + + * 2020-07-01: :class:`WebCategoriesOperations` + """ + api_version = self._get_api_version('web_categories') + if api_version == '2020-07-01': + from .v2020_07_01.operations import WebCategoriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'web_categories'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + def close(self): self._client.close() def __enter__(self): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py index d8412892224d1..5862e74a3b087 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py @@ -31,7 +31,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -41,7 +41,7 @@ def begin_delete_bastion_shareable_link( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -67,6 +67,8 @@ def begin_delete_bastion_shareable_link( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_delete_bastion_shareable_link'".format(api_version)) mixin_instance = OperationClass() @@ -80,7 +82,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): """Generates a unique VPN profile for P2S clients for VirtualWan and associated @@ -93,7 +95,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :type virtual_wan_name: str :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation operation. - :type vpn_client_params: ~azure.mgmt.network.v2020_06_01.models.VirtualWanVpnProfileParameters + :type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -101,7 +103,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_generatevirtualwanvpnserverconfigurationvpnprofile') @@ -121,6 +123,8 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_generatevirtualwanvpnserverconfigurationvpnprofile'".format(api_version)) mixin_instance = OperationClass() @@ -149,7 +153,7 @@ def begin_get_active_sessions( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult]] + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_get_active_sessions') @@ -167,6 +171,8 @@ def begin_get_active_sessions( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_get_active_sessions'".format(api_version)) mixin_instance = OperationClass() @@ -180,7 +186,7 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): """Creates a Bastion Shareable Links for all the VMs specified in the request. @@ -190,7 +196,7 @@ def begin_put_bastion_shareable_link( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -198,7 +204,7 @@ def begin_put_bastion_shareable_link( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]] + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_put_bastion_shareable_link') @@ -216,6 +222,8 @@ def begin_put_bastion_shareable_link( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_put_bastion_shareable_link'".format(api_version)) mixin_instance = OperationClass() @@ -240,7 +248,7 @@ def check_dns_name_availability( :type domain_name_label: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DnsNameAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult + :rtype: ~azure.mgmt.network.v2020_07_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('check_dns_name_availability') @@ -304,6 +312,8 @@ def check_dns_name_availability( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_dns_name_availability'".format(api_version)) mixin_instance = OperationClass() @@ -317,7 +327,7 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): """Returns the list of currently active sessions on the Bastion. @@ -327,10 +337,10 @@ def disconnect_active_sessions( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param session_ids: The list of sessionids to disconnect. - :type session_ids: ~azure.mgmt.network.v2020_06_01.models.SessionIds + :type session_ids: ~azure.mgmt.network.v2020_07_01.models.SessionIds :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('disconnect_active_sessions') @@ -348,6 +358,8 @@ def disconnect_active_sessions( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'disconnect_active_sessions'".format(api_version)) mixin_instance = OperationClass() @@ -361,7 +373,7 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): """Return the Bastion Shareable Links for all the VMs specified in the request. @@ -371,10 +383,10 @@ def get_bastion_shareable_link( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_bastion_shareable_link') @@ -392,6 +404,8 @@ def get_bastion_shareable_link( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_bastion_shareable_link'".format(api_version)) mixin_instance = OperationClass() @@ -416,7 +430,7 @@ def supported_security_providers( :type virtual_wan_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualWanSecurityProviders, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('supported_security_providers') @@ -452,6 +466,8 @@ def supported_security_providers( from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'supported_security_providers'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client.py index 369576dbb1718..462307ac11844 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client.py @@ -46,7 +46,7 @@ class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-06-01' + DEFAULT_API_VERSION = '2020-07-01' _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -114,6 +114,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-04-01: :mod:`v2020_04_01.models` * 2020-05-01: :mod:`v2020_05_01.models` * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-07-01: :mod:`v2020_07_01.models` """ if api_version == '2015-06-15': from ..v2015_06_15 import models @@ -205,6 +206,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-06-01': from ..v2020_06_01 import models return models + elif api_version == '2020-07-01': + from ..v2020_07_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -213,12 +217,15 @@ def application_gateway_private_endpoint_connections(self): * 2020-05-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` * 2020-06-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` + * 2020-07-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('application_gateway_private_endpoint_connections') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_gateway_private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -229,12 +236,15 @@ def application_gateway_private_link_resources(self): * 2020-05-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` * 2020-06-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` + * 2020-07-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` """ api_version = self._get_api_version('application_gateway_private_link_resources') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_gateway_private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -273,6 +283,7 @@ def application_gateways(self): * 2020-04-01: :class:`ApplicationGatewaysOperations` * 2020-05-01: :class:`ApplicationGatewaysOperations` * 2020-06-01: :class:`ApplicationGatewaysOperations` + * 2020-07-01: :class:`ApplicationGatewaysOperations` """ api_version = self._get_api_version('application_gateways') if api_version == '2015-06-15': @@ -335,6 +346,8 @@ def application_gateways(self): from ..v2020_05_01.aio.operations import ApplicationGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ApplicationGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -367,6 +380,7 @@ def application_security_groups(self): * 2020-04-01: :class:`ApplicationSecurityGroupsOperations` * 2020-05-01: :class:`ApplicationSecurityGroupsOperations` * 2020-06-01: :class:`ApplicationSecurityGroupsOperations` + * 2020-07-01: :class:`ApplicationSecurityGroupsOperations` """ api_version = self._get_api_version('application_security_groups') if api_version == '2017-09-01': @@ -417,6 +431,8 @@ def application_security_groups(self): from ..v2020_05_01.aio.operations import ApplicationSecurityGroupsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ApplicationSecurityGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'application_security_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -441,6 +457,7 @@ def available_delegations(self): * 2020-04-01: :class:`AvailableDelegationsOperations` * 2020-05-01: :class:`AvailableDelegationsOperations` * 2020-06-01: :class:`AvailableDelegationsOperations` + * 2020-07-01: :class:`AvailableDelegationsOperations` """ api_version = self._get_api_version('available_delegations') if api_version == '2018-08-01': @@ -475,6 +492,8 @@ def available_delegations(self): from ..v2020_05_01.aio.operations import AvailableDelegationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AvailableDelegationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_delegations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -509,6 +528,7 @@ def available_endpoint_services(self): * 2020-04-01: :class:`AvailableEndpointServicesOperations` * 2020-05-01: :class:`AvailableEndpointServicesOperations` * 2020-06-01: :class:`AvailableEndpointServicesOperations` + * 2020-07-01: :class:`AvailableEndpointServicesOperations` """ api_version = self._get_api_version('available_endpoint_services') if api_version == '2017-06-01': @@ -563,6 +583,8 @@ def available_endpoint_services(self): from ..v2020_05_01.aio.operations import AvailableEndpointServicesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AvailableEndpointServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_endpoint_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -582,6 +604,7 @@ def available_private_endpoint_types(self): * 2020-04-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-05-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-06-01: :class:`AvailablePrivateEndpointTypesOperations` + * 2020-07-01: :class:`AvailablePrivateEndpointTypesOperations` """ api_version = self._get_api_version('available_private_endpoint_types') if api_version == '2019-04-01': @@ -606,6 +629,8 @@ def available_private_endpoint_types(self): from ..v2020_05_01.aio.operations import AvailablePrivateEndpointTypesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AvailablePrivateEndpointTypesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AvailablePrivateEndpointTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_private_endpoint_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -630,6 +655,7 @@ def available_resource_group_delegations(self): * 2020-04-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-05-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-06-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2020-07-01: :class:`AvailableResourceGroupDelegationsOperations` """ api_version = self._get_api_version('available_resource_group_delegations') if api_version == '2018-08-01': @@ -664,6 +690,8 @@ def available_resource_group_delegations(self): from ..v2020_05_01.aio.operations import AvailableResourceGroupDelegationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AvailableResourceGroupDelegationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_resource_group_delegations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -680,6 +708,7 @@ def available_service_aliases(self): * 2020-04-01: :class:`AvailableServiceAliasesOperations` * 2020-05-01: :class:`AvailableServiceAliasesOperations` * 2020-06-01: :class:`AvailableServiceAliasesOperations` + * 2020-07-01: :class:`AvailableServiceAliasesOperations` """ api_version = self._get_api_version('available_service_aliases') if api_version == '2019-08-01': @@ -698,6 +727,8 @@ def available_service_aliases(self): from ..v2020_05_01.aio.operations import AvailableServiceAliasesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AvailableServiceAliasesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AvailableServiceAliasesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'available_service_aliases'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -722,6 +753,7 @@ def azure_firewall_fqdn_tags(self): * 2020-04-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-05-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-06-01: :class:`AzureFirewallFqdnTagsOperations` + * 2020-07-01: :class:`AzureFirewallFqdnTagsOperations` """ api_version = self._get_api_version('azure_firewall_fqdn_tags') if api_version == '2018-08-01': @@ -756,6 +788,8 @@ def azure_firewall_fqdn_tags(self): from ..v2020_05_01.aio.operations import AzureFirewallFqdnTagsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AzureFirewallFqdnTagsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'azure_firewall_fqdn_tags'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -783,6 +817,7 @@ def azure_firewalls(self): * 2020-04-01: :class:`AzureFirewallsOperations` * 2020-05-01: :class:`AzureFirewallsOperations` * 2020-06-01: :class:`AzureFirewallsOperations` + * 2020-07-01: :class:`AzureFirewallsOperations` """ api_version = self._get_api_version('azure_firewalls') if api_version == '2018-04-01': @@ -823,6 +858,8 @@ def azure_firewalls(self): from ..v2020_05_01.aio.operations import AzureFirewallsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AzureFirewallsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'azure_firewalls'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -842,6 +879,7 @@ def bastion_hosts(self): * 2020-04-01: :class:`BastionHostsOperations` * 2020-05-01: :class:`BastionHostsOperations` * 2020-06-01: :class:`BastionHostsOperations` + * 2020-07-01: :class:`BastionHostsOperations` """ api_version = self._get_api_version('bastion_hosts') if api_version == '2019-04-01': @@ -866,6 +904,8 @@ def bastion_hosts(self): from ..v2020_05_01.aio.operations import BastionHostsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import BastionHostsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import BastionHostsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bastion_hosts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -902,6 +942,7 @@ def bgp_service_communities(self): * 2020-04-01: :class:`BgpServiceCommunitiesOperations` * 2020-05-01: :class:`BgpServiceCommunitiesOperations` * 2020-06-01: :class:`BgpServiceCommunitiesOperations` + * 2020-07-01: :class:`BgpServiceCommunitiesOperations` """ api_version = self._get_api_version('bgp_service_communities') if api_version == '2016-12-01': @@ -960,6 +1001,8 @@ def bgp_service_communities(self): from ..v2020_05_01.aio.operations import BgpServiceCommunitiesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import BgpServiceCommunitiesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'bgp_service_communities'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -991,6 +1034,7 @@ def connection_monitors(self): * 2020-04-01: :class:`ConnectionMonitorsOperations` * 2020-05-01: :class:`ConnectionMonitorsOperations` * 2020-06-01: :class:`ConnectionMonitorsOperations` + * 2020-07-01: :class:`ConnectionMonitorsOperations` """ api_version = self._get_api_version('connection_monitors') if api_version == '2017-10-01': @@ -1039,6 +1083,8 @@ def connection_monitors(self): from ..v2020_05_01.aio.operations import ConnectionMonitorsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ConnectionMonitorsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'connection_monitors'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1048,10 +1094,13 @@ def custom_ip_prefixes(self): """Instance depends on the API version: * 2020-06-01: :class:`CustomIPPrefixesOperations` + * 2020-07-01: :class:`CustomIPPrefixesOperations` """ api_version = self._get_api_version('custom_ip_prefixes') if api_version == '2020-06-01': from ..v2020_06_01.aio.operations import CustomIPPrefixesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import CustomIPPrefixesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'custom_ip_prefixes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1074,6 +1123,7 @@ def ddos_custom_policies(self): * 2020-04-01: :class:`DdosCustomPoliciesOperations` * 2020-05-01: :class:`DdosCustomPoliciesOperations` * 2020-06-01: :class:`DdosCustomPoliciesOperations` + * 2020-07-01: :class:`DdosCustomPoliciesOperations` """ api_version = self._get_api_version('ddos_custom_policies') if api_version == '2018-11-01': @@ -1104,6 +1154,8 @@ def ddos_custom_policies(self): from ..v2020_05_01.aio.operations import DdosCustomPoliciesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import DdosCustomPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ddos_custom_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1132,6 +1184,7 @@ def ddos_protection_plans(self): * 2020-04-01: :class:`DdosProtectionPlansOperations` * 2020-05-01: :class:`DdosProtectionPlansOperations` * 2020-06-01: :class:`DdosProtectionPlansOperations` + * 2020-07-01: :class:`DdosProtectionPlansOperations` """ api_version = self._get_api_version('ddos_protection_plans') if api_version == '2018-02-01': @@ -1174,6 +1227,8 @@ def ddos_protection_plans(self): from ..v2020_05_01.aio.operations import DdosProtectionPlansOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import DdosProtectionPlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ddos_protection_plans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1208,6 +1263,7 @@ def default_security_rules(self): * 2020-04-01: :class:`DefaultSecurityRulesOperations` * 2020-05-01: :class:`DefaultSecurityRulesOperations` * 2020-06-01: :class:`DefaultSecurityRulesOperations` + * 2020-07-01: :class:`DefaultSecurityRulesOperations` """ api_version = self._get_api_version('default_security_rules') if api_version == '2017-06-01': @@ -1262,6 +1318,8 @@ def default_security_rules(self): from ..v2020_05_01.aio.operations import DefaultSecurityRulesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import DefaultSecurityRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'default_security_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1271,10 +1329,13 @@ def dscp_configuration(self): """Instance depends on the API version: * 2020-06-01: :class:`DscpConfigurationOperations` + * 2020-07-01: :class:`DscpConfigurationOperations` """ api_version = self._get_api_version('dscp_configuration') if api_version == '2020-06-01': from ..v2020_06_01.aio.operations import DscpConfigurationOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import DscpConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'dscp_configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1313,6 +1374,7 @@ def express_route_circuit_authorizations(self): * 2020-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-05-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` """ api_version = self._get_api_version('express_route_circuit_authorizations') if api_version == '2015-06-15': @@ -1375,6 +1437,8 @@ def express_route_circuit_authorizations(self): from ..v2020_05_01.aio.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuit_authorizations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1403,6 +1467,7 @@ def express_route_circuit_connections(self): * 2020-04-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-05-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-06-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('express_route_circuit_connections') if api_version == '2018-02-01': @@ -1445,6 +1510,8 @@ def express_route_circuit_connections(self): from ..v2020_05_01.aio.operations import ExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteCircuitConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuit_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1483,6 +1550,7 @@ def express_route_circuit_peerings(self): * 2020-04-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-05-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-06-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitPeeringsOperations` """ api_version = self._get_api_version('express_route_circuit_peerings') if api_version == '2015-06-15': @@ -1545,6 +1613,8 @@ def express_route_circuit_peerings(self): from ..v2020_05_01.aio.operations import ExpressRouteCircuitPeeringsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteCircuitPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuit_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1583,6 +1653,7 @@ def express_route_circuits(self): * 2020-04-01: :class:`ExpressRouteCircuitsOperations` * 2020-05-01: :class:`ExpressRouteCircuitsOperations` * 2020-06-01: :class:`ExpressRouteCircuitsOperations` + * 2020-07-01: :class:`ExpressRouteCircuitsOperations` """ api_version = self._get_api_version('express_route_circuits') if api_version == '2015-06-15': @@ -1645,6 +1716,8 @@ def express_route_circuits(self): from ..v2020_05_01.aio.operations import ExpressRouteCircuitsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteCircuitsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_circuits'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1669,6 +1742,7 @@ def express_route_connections(self): * 2020-04-01: :class:`ExpressRouteConnectionsOperations` * 2020-05-01: :class:`ExpressRouteConnectionsOperations` * 2020-06-01: :class:`ExpressRouteConnectionsOperations` + * 2020-07-01: :class:`ExpressRouteConnectionsOperations` """ api_version = self._get_api_version('express_route_connections') if api_version == '2018-08-01': @@ -1703,6 +1777,8 @@ def express_route_connections(self): from ..v2020_05_01.aio.operations import ExpressRouteConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1731,6 +1807,7 @@ def express_route_cross_connection_peerings(self): * 2020-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-05-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2020-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` """ api_version = self._get_api_version('express_route_cross_connection_peerings') if api_version == '2018-02-01': @@ -1773,6 +1850,8 @@ def express_route_cross_connection_peerings(self): from ..v2020_05_01.aio.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_cross_connection_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1801,6 +1880,7 @@ def express_route_cross_connections(self): * 2020-04-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-05-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-06-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2020-07-01: :class:`ExpressRouteCrossConnectionsOperations` """ api_version = self._get_api_version('express_route_cross_connections') if api_version == '2018-02-01': @@ -1843,6 +1923,8 @@ def express_route_cross_connections(self): from ..v2020_05_01.aio.operations import ExpressRouteCrossConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteCrossConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_cross_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1867,6 +1949,7 @@ def express_route_gateways(self): * 2020-04-01: :class:`ExpressRouteGatewaysOperations` * 2020-05-01: :class:`ExpressRouteGatewaysOperations` * 2020-06-01: :class:`ExpressRouteGatewaysOperations` + * 2020-07-01: :class:`ExpressRouteGatewaysOperations` """ api_version = self._get_api_version('express_route_gateways') if api_version == '2018-08-01': @@ -1901,6 +1984,8 @@ def express_route_gateways(self): from ..v2020_05_01.aio.operations import ExpressRouteGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1925,6 +2010,7 @@ def express_route_links(self): * 2020-04-01: :class:`ExpressRouteLinksOperations` * 2020-05-01: :class:`ExpressRouteLinksOperations` * 2020-06-01: :class:`ExpressRouteLinksOperations` + * 2020-07-01: :class:`ExpressRouteLinksOperations` """ api_version = self._get_api_version('express_route_links') if api_version == '2018-08-01': @@ -1959,6 +2045,8 @@ def express_route_links(self): from ..v2020_05_01.aio.operations import ExpressRouteLinksOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1983,6 +2071,7 @@ def express_route_ports(self): * 2020-04-01: :class:`ExpressRoutePortsOperations` * 2020-05-01: :class:`ExpressRoutePortsOperations` * 2020-06-01: :class:`ExpressRoutePortsOperations` + * 2020-07-01: :class:`ExpressRoutePortsOperations` """ api_version = self._get_api_version('express_route_ports') if api_version == '2018-08-01': @@ -2017,6 +2106,8 @@ def express_route_ports(self): from ..v2020_05_01.aio.operations import ExpressRoutePortsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRoutePortsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_ports'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2041,6 +2132,7 @@ def express_route_ports_locations(self): * 2020-04-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-05-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-06-01: :class:`ExpressRoutePortsLocationsOperations` + * 2020-07-01: :class:`ExpressRoutePortsLocationsOperations` """ api_version = self._get_api_version('express_route_ports_locations') if api_version == '2018-08-01': @@ -2075,6 +2167,8 @@ def express_route_ports_locations(self): from ..v2020_05_01.aio.operations import ExpressRoutePortsLocationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRoutePortsLocationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_ports_locations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2113,6 +2207,7 @@ def express_route_service_providers(self): * 2020-04-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-05-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-06-01: :class:`ExpressRouteServiceProvidersOperations` + * 2020-07-01: :class:`ExpressRouteServiceProvidersOperations` """ api_version = self._get_api_version('express_route_service_providers') if api_version == '2015-06-15': @@ -2175,6 +2270,8 @@ def express_route_service_providers(self): from ..v2020_05_01.aio.operations import ExpressRouteServiceProvidersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ExpressRouteServiceProvidersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'express_route_service_providers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2193,6 +2290,7 @@ def firewall_policies(self): * 2020-04-01: :class:`FirewallPoliciesOperations` * 2020-05-01: :class:`FirewallPoliciesOperations` * 2020-06-01: :class:`FirewallPoliciesOperations` + * 2020-07-01: :class:`FirewallPoliciesOperations` """ api_version = self._get_api_version('firewall_policies') if api_version == '2019-06-01': @@ -2215,6 +2313,8 @@ def firewall_policies(self): from ..v2020_05_01.aio.operations import FirewallPoliciesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import FirewallPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import FirewallPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'firewall_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2225,12 +2325,15 @@ def firewall_policy_rule_collection_groups(self): * 2020-05-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` * 2020-06-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` + * 2020-07-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` """ api_version = self._get_api_version('firewall_policy_rule_collection_groups') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'firewall_policy_rule_collection_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2279,6 +2382,7 @@ def flow_logs(self): * 2020-04-01: :class:`FlowLogsOperations` * 2020-05-01: :class:`FlowLogsOperations` * 2020-06-01: :class:`FlowLogsOperations` + * 2020-07-01: :class:`FlowLogsOperations` """ api_version = self._get_api_version('flow_logs') if api_version == '2019-11-01': @@ -2293,6 +2397,8 @@ def flow_logs(self): from ..v2020_05_01.aio.operations import FlowLogsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import FlowLogsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import FlowLogsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'flow_logs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2304,6 +2410,7 @@ def hub_route_tables(self): * 2020-04-01: :class:`HubRouteTablesOperations` * 2020-05-01: :class:`HubRouteTablesOperations` * 2020-06-01: :class:`HubRouteTablesOperations` + * 2020-07-01: :class:`HubRouteTablesOperations` """ api_version = self._get_api_version('hub_route_tables') if api_version == '2020-04-01': @@ -2312,6 +2419,8 @@ def hub_route_tables(self): from ..v2020_05_01.aio.operations import HubRouteTablesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import HubRouteTablesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import HubRouteTablesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'hub_route_tables'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2339,6 +2448,7 @@ def hub_virtual_network_connections(self): * 2020-04-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-05-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-06-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2020-07-01: :class:`HubVirtualNetworkConnectionsOperations` """ api_version = self._get_api_version('hub_virtual_network_connections') if api_version == '2018-04-01': @@ -2379,6 +2489,8 @@ def hub_virtual_network_connections(self): from ..v2020_05_01.aio.operations import HubVirtualNetworkConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import HubVirtualNetworkConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'hub_virtual_network_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2413,6 +2525,7 @@ def inbound_nat_rules(self): * 2020-04-01: :class:`InboundNatRulesOperations` * 2020-05-01: :class:`InboundNatRulesOperations` * 2020-06-01: :class:`InboundNatRulesOperations` + * 2020-07-01: :class:`InboundNatRulesOperations` """ api_version = self._get_api_version('inbound_nat_rules') if api_version == '2017-06-01': @@ -2467,6 +2580,8 @@ def inbound_nat_rules(self): from ..v2020_05_01.aio.operations import InboundNatRulesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import InboundNatRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'inbound_nat_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2476,10 +2591,13 @@ def inbound_security_rule(self): """Instance depends on the API version: * 2020-06-01: :class:`InboundSecurityRuleOperations` + * 2020-07-01: :class:`InboundSecurityRuleOperations` """ api_version = self._get_api_version('inbound_security_rule') if api_version == '2020-06-01': from ..v2020_06_01.aio.operations import InboundSecurityRuleOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import InboundSecurityRuleOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'inbound_security_rule'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2517,6 +2635,7 @@ def ip_allocations(self): * 2020-04-01: :class:`IpAllocationsOperations` * 2020-05-01: :class:`IpAllocationsOperations` * 2020-06-01: :class:`IpAllocationsOperations` + * 2020-07-01: :class:`IpAllocationsOperations` """ api_version = self._get_api_version('ip_allocations') if api_version == '2020-03-01': @@ -2527,6 +2646,8 @@ def ip_allocations(self): from ..v2020_05_01.aio.operations import IpAllocationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import IpAllocationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import IpAllocationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ip_allocations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2542,6 +2663,7 @@ def ip_groups(self): * 2020-04-01: :class:`IpGroupsOperations` * 2020-05-01: :class:`IpGroupsOperations` * 2020-06-01: :class:`IpGroupsOperations` + * 2020-07-01: :class:`IpGroupsOperations` """ api_version = self._get_api_version('ip_groups') if api_version == '2019-09-01': @@ -2558,6 +2680,8 @@ def ip_groups(self): from ..v2020_05_01.aio.operations import IpGroupsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import IpGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import IpGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'ip_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2592,6 +2716,7 @@ def load_balancer_backend_address_pools(self): * 2020-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-05-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2020-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` """ api_version = self._get_api_version('load_balancer_backend_address_pools') if api_version == '2017-06-01': @@ -2646,6 +2771,8 @@ def load_balancer_backend_address_pools(self): from ..v2020_05_01.aio.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_backend_address_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2680,6 +2807,7 @@ def load_balancer_frontend_ip_configurations(self): * 2020-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-05-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2020-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` """ api_version = self._get_api_version('load_balancer_frontend_ip_configurations') if api_version == '2017-06-01': @@ -2734,6 +2862,8 @@ def load_balancer_frontend_ip_configurations(self): from ..v2020_05_01.aio.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_frontend_ip_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2768,6 +2898,7 @@ def load_balancer_load_balancing_rules(self): * 2020-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-05-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2020-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` """ api_version = self._get_api_version('load_balancer_load_balancing_rules') if api_version == '2017-06-01': @@ -2822,6 +2953,8 @@ def load_balancer_load_balancing_rules(self): from ..v2020_05_01.aio.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_load_balancing_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2856,6 +2989,7 @@ def load_balancer_network_interfaces(self): * 2020-04-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-05-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-06-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2020-07-01: :class:`LoadBalancerNetworkInterfacesOperations` """ api_version = self._get_api_version('load_balancer_network_interfaces') if api_version == '2017-06-01': @@ -2910,6 +3044,8 @@ def load_balancer_network_interfaces(self): from ..v2020_05_01.aio.operations import LoadBalancerNetworkInterfacesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancerNetworkInterfacesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_network_interfaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2934,6 +3070,7 @@ def load_balancer_outbound_rules(self): * 2020-04-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-05-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-06-01: :class:`LoadBalancerOutboundRulesOperations` + * 2020-07-01: :class:`LoadBalancerOutboundRulesOperations` """ api_version = self._get_api_version('load_balancer_outbound_rules') if api_version == '2018-08-01': @@ -2968,6 +3105,8 @@ def load_balancer_outbound_rules(self): from ..v2020_05_01.aio.operations import LoadBalancerOutboundRulesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancerOutboundRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_outbound_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3002,6 +3141,7 @@ def load_balancer_probes(self): * 2020-04-01: :class:`LoadBalancerProbesOperations` * 2020-05-01: :class:`LoadBalancerProbesOperations` * 2020-06-01: :class:`LoadBalancerProbesOperations` + * 2020-07-01: :class:`LoadBalancerProbesOperations` """ api_version = self._get_api_version('load_balancer_probes') if api_version == '2017-06-01': @@ -3056,6 +3196,8 @@ def load_balancer_probes(self): from ..v2020_05_01.aio.operations import LoadBalancerProbesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancerProbesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancer_probes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3094,6 +3236,7 @@ def load_balancers(self): * 2020-04-01: :class:`LoadBalancersOperations` * 2020-05-01: :class:`LoadBalancersOperations` * 2020-06-01: :class:`LoadBalancersOperations` + * 2020-07-01: :class:`LoadBalancersOperations` """ api_version = self._get_api_version('load_balancers') if api_version == '2015-06-15': @@ -3156,6 +3299,8 @@ def load_balancers(self): from ..v2020_05_01.aio.operations import LoadBalancersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LoadBalancersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LoadBalancersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'load_balancers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3194,6 +3339,7 @@ def local_network_gateways(self): * 2020-04-01: :class:`LocalNetworkGatewaysOperations` * 2020-05-01: :class:`LocalNetworkGatewaysOperations` * 2020-06-01: :class:`LocalNetworkGatewaysOperations` + * 2020-07-01: :class:`LocalNetworkGatewaysOperations` """ api_version = self._get_api_version('local_network_gateways') if api_version == '2015-06-15': @@ -3256,6 +3402,8 @@ def local_network_gateways(self): from ..v2020_05_01.aio.operations import LocalNetworkGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import LocalNetworkGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'local_network_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3276,6 +3424,7 @@ def nat_gateways(self): * 2020-04-01: :class:`NatGatewaysOperations` * 2020-05-01: :class:`NatGatewaysOperations` * 2020-06-01: :class:`NatGatewaysOperations` + * 2020-07-01: :class:`NatGatewaysOperations` """ api_version = self._get_api_version('nat_gateways') if api_version == '2019-02-01': @@ -3302,6 +3451,8 @@ def nat_gateways(self): from ..v2020_05_01.aio.operations import NatGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NatGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NatGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'nat_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3336,6 +3487,7 @@ def network_interface_ip_configurations(self): * 2020-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-05-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2020-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` """ api_version = self._get_api_version('network_interface_ip_configurations') if api_version == '2017-06-01': @@ -3390,6 +3542,8 @@ def network_interface_ip_configurations(self): from ..v2020_05_01.aio.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interface_ip_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3424,6 +3578,7 @@ def network_interface_load_balancers(self): * 2020-04-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-05-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-06-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2020-07-01: :class:`NetworkInterfaceLoadBalancersOperations` """ api_version = self._get_api_version('network_interface_load_balancers') if api_version == '2017-06-01': @@ -3478,6 +3633,8 @@ def network_interface_load_balancers(self): from ..v2020_05_01.aio.operations import NetworkInterfaceLoadBalancersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkInterfaceLoadBalancersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interface_load_balancers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3502,6 +3659,7 @@ def network_interface_tap_configurations(self): * 2020-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-05-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-06-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2020-07-01: :class:`NetworkInterfaceTapConfigurationsOperations` """ api_version = self._get_api_version('network_interface_tap_configurations') if api_version == '2018-08-01': @@ -3536,6 +3694,8 @@ def network_interface_tap_configurations(self): from ..v2020_05_01.aio.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interface_tap_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3574,6 +3734,7 @@ def network_interfaces(self): * 2020-04-01: :class:`NetworkInterfacesOperations` * 2020-05-01: :class:`NetworkInterfacesOperations` * 2020-06-01: :class:`NetworkInterfacesOperations` + * 2020-07-01: :class:`NetworkInterfacesOperations` """ api_version = self._get_api_version('network_interfaces') if api_version == '2015-06-15': @@ -3636,6 +3797,8 @@ def network_interfaces(self): from ..v2020_05_01.aio.operations import NetworkInterfacesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkInterfacesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_interfaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3660,6 +3823,7 @@ def network_profiles(self): * 2020-04-01: :class:`NetworkProfilesOperations` * 2020-05-01: :class:`NetworkProfilesOperations` * 2020-06-01: :class:`NetworkProfilesOperations` + * 2020-07-01: :class:`NetworkProfilesOperations` """ api_version = self._get_api_version('network_profiles') if api_version == '2018-08-01': @@ -3694,6 +3858,8 @@ def network_profiles(self): from ..v2020_05_01.aio.operations import NetworkProfilesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkProfilesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_profiles'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3732,6 +3898,7 @@ def network_security_groups(self): * 2020-04-01: :class:`NetworkSecurityGroupsOperations` * 2020-05-01: :class:`NetworkSecurityGroupsOperations` * 2020-06-01: :class:`NetworkSecurityGroupsOperations` + * 2020-07-01: :class:`NetworkSecurityGroupsOperations` """ api_version = self._get_api_version('network_security_groups') if api_version == '2015-06-15': @@ -3794,6 +3961,8 @@ def network_security_groups(self): from ..v2020_05_01.aio.operations import NetworkSecurityGroupsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkSecurityGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_security_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3807,6 +3976,7 @@ def network_virtual_appliances(self): * 2020-04-01: :class:`NetworkVirtualAppliancesOperations` * 2020-05-01: :class:`NetworkVirtualAppliancesOperations` * 2020-06-01: :class:`NetworkVirtualAppliancesOperations` + * 2020-07-01: :class:`NetworkVirtualAppliancesOperations` """ api_version = self._get_api_version('network_virtual_appliances') if api_version == '2019-12-01': @@ -3819,6 +3989,8 @@ def network_virtual_appliances(self): from ..v2020_05_01.aio.operations import NetworkVirtualAppliancesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkVirtualAppliancesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkVirtualAppliancesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_virtual_appliances'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3856,6 +4028,7 @@ def network_watchers(self): * 2020-04-01: :class:`NetworkWatchersOperations` * 2020-05-01: :class:`NetworkWatchersOperations` * 2020-06-01: :class:`NetworkWatchersOperations` + * 2020-07-01: :class:`NetworkWatchersOperations` """ api_version = self._get_api_version('network_watchers') if api_version == '2016-09-01': @@ -3916,6 +4089,8 @@ def network_watchers(self): from ..v2020_05_01.aio.operations import NetworkWatchersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkWatchersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'network_watchers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3948,6 +4123,7 @@ def operations(self): * 2020-04-01: :class:`Operations` * 2020-05-01: :class:`Operations` * 2020-06-01: :class:`Operations` + * 2020-07-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-09-01': @@ -3998,6 +4174,8 @@ def operations(self): from ..v2020_05_01.aio.operations import Operations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import Operations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4022,6 +4200,7 @@ def p2_svpn_gateways(self): * 2020-04-01: :class:`P2SVpnGatewaysOperations` * 2020-05-01: :class:`P2SVpnGatewaysOperations` * 2020-06-01: :class:`P2SVpnGatewaysOperations` + * 2020-07-01: :class:`P2SVpnGatewaysOperations` """ api_version = self._get_api_version('p2_svpn_gateways') if api_version == '2018-08-01': @@ -4056,6 +4235,8 @@ def p2_svpn_gateways(self): from ..v2020_05_01.aio.operations import P2SVpnGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import P2SVpnGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import P2SVpnGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'p2_svpn_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4127,6 +4308,7 @@ def packet_captures(self): * 2020-04-01: :class:`PacketCapturesOperations` * 2020-05-01: :class:`PacketCapturesOperations` * 2020-06-01: :class:`PacketCapturesOperations` + * 2020-07-01: :class:`PacketCapturesOperations` """ api_version = self._get_api_version('packet_captures') if api_version == '2016-09-01': @@ -4187,6 +4369,8 @@ def packet_captures(self): from ..v2020_05_01.aio.operations import PacketCapturesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PacketCapturesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PacketCapturesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'packet_captures'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4208,6 +4392,7 @@ def peer_express_route_circuit_connections(self): * 2020-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-05-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-06-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2020-07-01: :class:`PeerExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('peer_express_route_circuit_connections') if api_version == '2018-12-01': @@ -4236,6 +4421,8 @@ def peer_express_route_circuit_connections(self): from ..v2020_05_01.aio.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'peer_express_route_circuit_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4248,6 +4435,7 @@ def private_dns_zone_groups(self): * 2020-04-01: :class:`PrivateDnsZoneGroupsOperations` * 2020-05-01: :class:`PrivateDnsZoneGroupsOperations` * 2020-06-01: :class:`PrivateDnsZoneGroupsOperations` + * 2020-07-01: :class:`PrivateDnsZoneGroupsOperations` """ api_version = self._get_api_version('private_dns_zone_groups') if api_version == '2020-03-01': @@ -4258,6 +4446,8 @@ def private_dns_zone_groups(self): from ..v2020_05_01.aio.operations import PrivateDnsZoneGroupsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PrivateDnsZoneGroupsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PrivateDnsZoneGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_dns_zone_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4277,6 +4467,7 @@ def private_endpoints(self): * 2020-04-01: :class:`PrivateEndpointsOperations` * 2020-05-01: :class:`PrivateEndpointsOperations` * 2020-06-01: :class:`PrivateEndpointsOperations` + * 2020-07-01: :class:`PrivateEndpointsOperations` """ api_version = self._get_api_version('private_endpoints') if api_version == '2019-04-01': @@ -4301,6 +4492,8 @@ def private_endpoints(self): from ..v2020_05_01.aio.operations import PrivateEndpointsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PrivateEndpointsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PrivateEndpointsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoints'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4320,6 +4513,7 @@ def private_link_services(self): * 2020-04-01: :class:`PrivateLinkServicesOperations` * 2020-05-01: :class:`PrivateLinkServicesOperations` * 2020-06-01: :class:`PrivateLinkServicesOperations` + * 2020-07-01: :class:`PrivateLinkServicesOperations` """ api_version = self._get_api_version('private_link_services') if api_version == '2019-04-01': @@ -4344,6 +4538,8 @@ def private_link_services(self): from ..v2020_05_01.aio.operations import PrivateLinkServicesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PrivateLinkServicesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PrivateLinkServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4382,6 +4578,7 @@ def public_ip_addresses(self): * 2020-04-01: :class:`PublicIPAddressesOperations` * 2020-05-01: :class:`PublicIPAddressesOperations` * 2020-06-01: :class:`PublicIPAddressesOperations` + * 2020-07-01: :class:`PublicIPAddressesOperations` """ api_version = self._get_api_version('public_ip_addresses') if api_version == '2015-06-15': @@ -4444,6 +4641,8 @@ def public_ip_addresses(self): from ..v2020_05_01.aio.operations import PublicIPAddressesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PublicIPAddressesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'public_ip_addresses'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4469,6 +4668,7 @@ def public_ip_prefixes(self): * 2020-04-01: :class:`PublicIPPrefixesOperations` * 2020-05-01: :class:`PublicIPPrefixesOperations` * 2020-06-01: :class:`PublicIPPrefixesOperations` + * 2020-07-01: :class:`PublicIPPrefixesOperations` """ api_version = self._get_api_version('public_ip_prefixes') if api_version == '2018-07-01': @@ -4505,6 +4705,8 @@ def public_ip_prefixes(self): from ..v2020_05_01.aio.operations import PublicIPPrefixesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PublicIPPrefixesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'public_ip_prefixes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4525,6 +4727,7 @@ def resource_navigation_links(self): * 2020-04-01: :class:`ResourceNavigationLinksOperations` * 2020-05-01: :class:`ResourceNavigationLinksOperations` * 2020-06-01: :class:`ResourceNavigationLinksOperations` + * 2020-07-01: :class:`ResourceNavigationLinksOperations` """ api_version = self._get_api_version('resource_navigation_links') if api_version == '2019-02-01': @@ -4551,6 +4754,8 @@ def resource_navigation_links(self): from ..v2020_05_01.aio.operations import ResourceNavigationLinksOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ResourceNavigationLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resource_navigation_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4587,6 +4792,7 @@ def route_filter_rules(self): * 2020-04-01: :class:`RouteFilterRulesOperations` * 2020-05-01: :class:`RouteFilterRulesOperations` * 2020-06-01: :class:`RouteFilterRulesOperations` + * 2020-07-01: :class:`RouteFilterRulesOperations` """ api_version = self._get_api_version('route_filter_rules') if api_version == '2016-12-01': @@ -4645,6 +4851,8 @@ def route_filter_rules(self): from ..v2020_05_01.aio.operations import RouteFilterRulesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import RouteFilterRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'route_filter_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4681,6 +4889,7 @@ def route_filters(self): * 2020-04-01: :class:`RouteFiltersOperations` * 2020-05-01: :class:`RouteFiltersOperations` * 2020-06-01: :class:`RouteFiltersOperations` + * 2020-07-01: :class:`RouteFiltersOperations` """ api_version = self._get_api_version('route_filters') if api_version == '2016-12-01': @@ -4739,6 +4948,8 @@ def route_filters(self): from ..v2020_05_01.aio.operations import RouteFiltersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import RouteFiltersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import RouteFiltersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'route_filters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4777,6 +4988,7 @@ def route_tables(self): * 2020-04-01: :class:`RouteTablesOperations` * 2020-05-01: :class:`RouteTablesOperations` * 2020-06-01: :class:`RouteTablesOperations` + * 2020-07-01: :class:`RouteTablesOperations` """ api_version = self._get_api_version('route_tables') if api_version == '2015-06-15': @@ -4839,6 +5051,8 @@ def route_tables(self): from ..v2020_05_01.aio.operations import RouteTablesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import RouteTablesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import RouteTablesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'route_tables'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4877,6 +5091,7 @@ def routes(self): * 2020-04-01: :class:`RoutesOperations` * 2020-05-01: :class:`RoutesOperations` * 2020-06-01: :class:`RoutesOperations` + * 2020-07-01: :class:`RoutesOperations` """ api_version = self._get_api_version('routes') if api_version == '2015-06-15': @@ -4939,6 +5154,8 @@ def routes(self): from ..v2020_05_01.aio.operations import RoutesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import RoutesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import RoutesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'routes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4951,6 +5168,7 @@ def security_partner_providers(self): * 2020-04-01: :class:`SecurityPartnerProvidersOperations` * 2020-05-01: :class:`SecurityPartnerProvidersOperations` * 2020-06-01: :class:`SecurityPartnerProvidersOperations` + * 2020-07-01: :class:`SecurityPartnerProvidersOperations` """ api_version = self._get_api_version('security_partner_providers') if api_version == '2020-03-01': @@ -4961,6 +5179,8 @@ def security_partner_providers(self): from ..v2020_05_01.aio.operations import SecurityPartnerProvidersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import SecurityPartnerProvidersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import SecurityPartnerProvidersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'security_partner_providers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4999,6 +5219,7 @@ def security_rules(self): * 2020-04-01: :class:`SecurityRulesOperations` * 2020-05-01: :class:`SecurityRulesOperations` * 2020-06-01: :class:`SecurityRulesOperations` + * 2020-07-01: :class:`SecurityRulesOperations` """ api_version = self._get_api_version('security_rules') if api_version == '2015-06-15': @@ -5061,6 +5282,8 @@ def security_rules(self): from ..v2020_05_01.aio.operations import SecurityRulesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import SecurityRulesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import SecurityRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'security_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5081,6 +5304,7 @@ def service_association_links(self): * 2020-04-01: :class:`ServiceAssociationLinksOperations` * 2020-05-01: :class:`ServiceAssociationLinksOperations` * 2020-06-01: :class:`ServiceAssociationLinksOperations` + * 2020-07-01: :class:`ServiceAssociationLinksOperations` """ api_version = self._get_api_version('service_association_links') if api_version == '2019-02-01': @@ -5107,6 +5331,8 @@ def service_association_links(self): from ..v2020_05_01.aio.operations import ServiceAssociationLinksOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ServiceAssociationLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_association_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5132,6 +5358,7 @@ def service_endpoint_policies(self): * 2020-04-01: :class:`ServiceEndpointPoliciesOperations` * 2020-05-01: :class:`ServiceEndpointPoliciesOperations` * 2020-06-01: :class:`ServiceEndpointPoliciesOperations` + * 2020-07-01: :class:`ServiceEndpointPoliciesOperations` """ api_version = self._get_api_version('service_endpoint_policies') if api_version == '2018-07-01': @@ -5168,6 +5395,8 @@ def service_endpoint_policies(self): from ..v2020_05_01.aio.operations import ServiceEndpointPoliciesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ServiceEndpointPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_endpoint_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5193,6 +5422,7 @@ def service_endpoint_policy_definitions(self): * 2020-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-05-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-06-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2020-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` """ api_version = self._get_api_version('service_endpoint_policy_definitions') if api_version == '2018-07-01': @@ -5229,6 +5459,8 @@ def service_endpoint_policy_definitions(self): from ..v2020_05_01.aio.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_endpoint_policy_definitions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5248,6 +5480,7 @@ def service_tags(self): * 2020-04-01: :class:`ServiceTagsOperations` * 2020-05-01: :class:`ServiceTagsOperations` * 2020-06-01: :class:`ServiceTagsOperations` + * 2020-07-01: :class:`ServiceTagsOperations` """ api_version = self._get_api_version('service_tags') if api_version == '2019-04-01': @@ -5272,6 +5505,8 @@ def service_tags(self): from ..v2020_05_01.aio.operations import ServiceTagsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import ServiceTagsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ServiceTagsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'service_tags'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5310,6 +5545,7 @@ def subnets(self): * 2020-04-01: :class:`SubnetsOperations` * 2020-05-01: :class:`SubnetsOperations` * 2020-06-01: :class:`SubnetsOperations` + * 2020-07-01: :class:`SubnetsOperations` """ api_version = self._get_api_version('subnets') if api_version == '2015-06-15': @@ -5372,6 +5608,8 @@ def subnets(self): from ..v2020_05_01.aio.operations import SubnetsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import SubnetsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import SubnetsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'subnets'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5410,6 +5648,7 @@ def usages(self): * 2020-04-01: :class:`UsagesOperations` * 2020-05-01: :class:`UsagesOperations` * 2020-06-01: :class:`UsagesOperations` + * 2020-07-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2015-06-15': @@ -5472,6 +5711,8 @@ def usages(self): from ..v2020_05_01.aio.operations import UsagesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import UsagesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import UsagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5482,12 +5723,15 @@ def virtual_appliance_sites(self): * 2020-05-01: :class:`VirtualApplianceSitesOperations` * 2020-06-01: :class:`VirtualApplianceSitesOperations` + * 2020-07-01: :class:`VirtualApplianceSitesOperations` """ api_version = self._get_api_version('virtual_appliance_sites') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import VirtualApplianceSitesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualApplianceSitesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualApplianceSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_appliance_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5498,12 +5742,15 @@ def virtual_appliance_skus(self): * 2020-05-01: :class:`VirtualApplianceSkusOperations` * 2020-06-01: :class:`VirtualApplianceSkusOperations` + * 2020-07-01: :class:`VirtualApplianceSkusOperations` """ api_version = self._get_api_version('virtual_appliance_skus') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import VirtualApplianceSkusOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualApplianceSkusOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualApplianceSkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_appliance_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5514,12 +5761,15 @@ def virtual_hub_bgp_connection(self): * 2020-05-01: :class:`VirtualHubBgpConnectionOperations` * 2020-06-01: :class:`VirtualHubBgpConnectionOperations` + * 2020-07-01: :class:`VirtualHubBgpConnectionOperations` """ api_version = self._get_api_version('virtual_hub_bgp_connection') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import VirtualHubBgpConnectionOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualHubBgpConnectionOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualHubBgpConnectionOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_bgp_connection'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5530,12 +5780,15 @@ def virtual_hub_bgp_connections(self): * 2020-05-01: :class:`VirtualHubBgpConnectionsOperations` * 2020-06-01: :class:`VirtualHubBgpConnectionsOperations` + * 2020-07-01: :class:`VirtualHubBgpConnectionsOperations` """ api_version = self._get_api_version('virtual_hub_bgp_connections') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import VirtualHubBgpConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualHubBgpConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualHubBgpConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_bgp_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5546,12 +5799,15 @@ def virtual_hub_ip_configuration(self): * 2020-05-01: :class:`VirtualHubIpConfigurationOperations` * 2020-06-01: :class:`VirtualHubIpConfigurationOperations` + * 2020-07-01: :class:`VirtualHubIpConfigurationOperations` """ api_version = self._get_api_version('virtual_hub_ip_configuration') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import VirtualHubIpConfigurationOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualHubIpConfigurationOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualHubIpConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_ip_configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5567,6 +5823,7 @@ def virtual_hub_route_table_v2_s(self): * 2020-04-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-05-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-06-01: :class:`VirtualHubRouteTableV2SOperations` + * 2020-07-01: :class:`VirtualHubRouteTableV2SOperations` """ api_version = self._get_api_version('virtual_hub_route_table_v2_s') if api_version == '2019-09-01': @@ -5583,6 +5840,8 @@ def virtual_hub_route_table_v2_s(self): from ..v2020_05_01.aio.operations import VirtualHubRouteTableV2SOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualHubRouteTableV2SOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualHubRouteTableV2SOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hub_route_table_v2_s'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5610,6 +5869,7 @@ def virtual_hubs(self): * 2020-04-01: :class:`VirtualHubsOperations` * 2020-05-01: :class:`VirtualHubsOperations` * 2020-06-01: :class:`VirtualHubsOperations` + * 2020-07-01: :class:`VirtualHubsOperations` """ api_version = self._get_api_version('virtual_hubs') if api_version == '2018-04-01': @@ -5650,6 +5910,8 @@ def virtual_hubs(self): from ..v2020_05_01.aio.operations import VirtualHubsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualHubsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualHubsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_hubs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5688,6 +5950,7 @@ def virtual_network_gateway_connections(self): * 2020-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-05-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2020-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` """ api_version = self._get_api_version('virtual_network_gateway_connections') if api_version == '2015-06-15': @@ -5750,6 +6013,8 @@ def virtual_network_gateway_connections(self): from ..v2020_05_01.aio.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_gateway_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5788,6 +6053,7 @@ def virtual_network_gateways(self): * 2020-04-01: :class:`VirtualNetworkGatewaysOperations` * 2020-05-01: :class:`VirtualNetworkGatewaysOperations` * 2020-06-01: :class:`VirtualNetworkGatewaysOperations` + * 2020-07-01: :class:`VirtualNetworkGatewaysOperations` """ api_version = self._get_api_version('virtual_network_gateways') if api_version == '2015-06-15': @@ -5850,6 +6116,8 @@ def virtual_network_gateways(self): from ..v2020_05_01.aio.operations import VirtualNetworkGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualNetworkGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5887,6 +6155,7 @@ def virtual_network_peerings(self): * 2020-04-01: :class:`VirtualNetworkPeeringsOperations` * 2020-05-01: :class:`VirtualNetworkPeeringsOperations` * 2020-06-01: :class:`VirtualNetworkPeeringsOperations` + * 2020-07-01: :class:`VirtualNetworkPeeringsOperations` """ api_version = self._get_api_version('virtual_network_peerings') if api_version == '2016-09-01': @@ -5947,6 +6216,8 @@ def virtual_network_peerings(self): from ..v2020_05_01.aio.operations import VirtualNetworkPeeringsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualNetworkPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5971,6 +6242,7 @@ def virtual_network_taps(self): * 2020-04-01: :class:`VirtualNetworkTapsOperations` * 2020-05-01: :class:`VirtualNetworkTapsOperations` * 2020-06-01: :class:`VirtualNetworkTapsOperations` + * 2020-07-01: :class:`VirtualNetworkTapsOperations` """ api_version = self._get_api_version('virtual_network_taps') if api_version == '2018-08-01': @@ -6005,6 +6277,8 @@ def virtual_network_taps(self): from ..v2020_05_01.aio.operations import VirtualNetworkTapsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualNetworkTapsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_network_taps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6043,6 +6317,7 @@ def virtual_networks(self): * 2020-04-01: :class:`VirtualNetworksOperations` * 2020-05-01: :class:`VirtualNetworksOperations` * 2020-06-01: :class:`VirtualNetworksOperations` + * 2020-07-01: :class:`VirtualNetworksOperations` """ api_version = self._get_api_version('virtual_networks') if api_version == '2015-06-15': @@ -6105,6 +6380,8 @@ def virtual_networks(self): from ..v2020_05_01.aio.operations import VirtualNetworksOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualNetworksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_networks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6122,6 +6399,7 @@ def virtual_router_peerings(self): * 2020-04-01: :class:`VirtualRouterPeeringsOperations` * 2020-05-01: :class:`VirtualRouterPeeringsOperations` * 2020-06-01: :class:`VirtualRouterPeeringsOperations` + * 2020-07-01: :class:`VirtualRouterPeeringsOperations` """ api_version = self._get_api_version('virtual_router_peerings') if api_version == '2019-07-01': @@ -6142,6 +6420,8 @@ def virtual_router_peerings(self): from ..v2020_05_01.aio.operations import VirtualRouterPeeringsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualRouterPeeringsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualRouterPeeringsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_router_peerings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6159,6 +6439,7 @@ def virtual_routers(self): * 2020-04-01: :class:`VirtualRoutersOperations` * 2020-05-01: :class:`VirtualRoutersOperations` * 2020-06-01: :class:`VirtualRoutersOperations` + * 2020-07-01: :class:`VirtualRoutersOperations` """ api_version = self._get_api_version('virtual_routers') if api_version == '2019-07-01': @@ -6179,6 +6460,8 @@ def virtual_routers(self): from ..v2020_05_01.aio.operations import VirtualRoutersOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualRoutersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualRoutersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_routers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6206,6 +6489,7 @@ def virtual_wans(self): * 2020-04-01: :class:`VirtualWansOperations` * 2020-05-01: :class:`VirtualWansOperations` * 2020-06-01: :class:`VirtualWansOperations` + * 2020-07-01: :class:`VirtualWansOperations` """ api_version = self._get_api_version('virtual_wans') if api_version == '2018-04-01': @@ -6246,6 +6530,8 @@ def virtual_wans(self): from ..v2020_05_01.aio.operations import VirtualWansOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VirtualWansOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VirtualWansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'virtual_wans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6273,6 +6559,7 @@ def vpn_connections(self): * 2020-04-01: :class:`VpnConnectionsOperations` * 2020-05-01: :class:`VpnConnectionsOperations` * 2020-06-01: :class:`VpnConnectionsOperations` + * 2020-07-01: :class:`VpnConnectionsOperations` """ api_version = self._get_api_version('vpn_connections') if api_version == '2018-04-01': @@ -6313,6 +6600,8 @@ def vpn_connections(self): from ..v2020_05_01.aio.operations import VpnConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6340,6 +6629,7 @@ def vpn_gateways(self): * 2020-04-01: :class:`VpnGatewaysOperations` * 2020-05-01: :class:`VpnGatewaysOperations` * 2020-06-01: :class:`VpnGatewaysOperations` + * 2020-07-01: :class:`VpnGatewaysOperations` """ api_version = self._get_api_version('vpn_gateways') if api_version == '2018-04-01': @@ -6380,6 +6670,8 @@ def vpn_gateways(self): from ..v2020_05_01.aio.operations import VpnGatewaysOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnGatewaysOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_gateways'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6398,6 +6690,7 @@ def vpn_link_connections(self): * 2020-04-01: :class:`VpnLinkConnectionsOperations` * 2020-05-01: :class:`VpnLinkConnectionsOperations` * 2020-06-01: :class:`VpnLinkConnectionsOperations` + * 2020-07-01: :class:`VpnLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_link_connections') if api_version == '2019-06-01': @@ -6420,6 +6713,8 @@ def vpn_link_connections(self): from ..v2020_05_01.aio.operations import VpnLinkConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnLinkConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnLinkConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_link_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6436,6 +6731,7 @@ def vpn_server_configurations(self): * 2020-04-01: :class:`VpnServerConfigurationsOperations` * 2020-05-01: :class:`VpnServerConfigurationsOperations` * 2020-06-01: :class:`VpnServerConfigurationsOperations` + * 2020-07-01: :class:`VpnServerConfigurationsOperations` """ api_version = self._get_api_version('vpn_server_configurations') if api_version == '2019-08-01': @@ -6454,6 +6750,8 @@ def vpn_server_configurations(self): from ..v2020_05_01.aio.operations import VpnServerConfigurationsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnServerConfigurationsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnServerConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_server_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6470,6 +6768,7 @@ def vpn_server_configurations_associated_with_virtual_wan(self): * 2020-04-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-05-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-06-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` + * 2020-07-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` """ api_version = self._get_api_version('vpn_server_configurations_associated_with_virtual_wan') if api_version == '2019-08-01': @@ -6488,6 +6787,8 @@ def vpn_server_configurations_associated_with_virtual_wan(self): from ..v2020_05_01.aio.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_server_configurations_associated_with_virtual_wan'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6506,6 +6807,7 @@ def vpn_site_link_connections(self): * 2020-04-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-05-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-06-01: :class:`VpnSiteLinkConnectionsOperations` + * 2020-07-01: :class:`VpnSiteLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_site_link_connections') if api_version == '2019-06-01': @@ -6528,6 +6830,8 @@ def vpn_site_link_connections(self): from ..v2020_05_01.aio.operations import VpnSiteLinkConnectionsOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnSiteLinkConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnSiteLinkConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_site_link_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6546,6 +6850,7 @@ def vpn_site_links(self): * 2020-04-01: :class:`VpnSiteLinksOperations` * 2020-05-01: :class:`VpnSiteLinksOperations` * 2020-06-01: :class:`VpnSiteLinksOperations` + * 2020-07-01: :class:`VpnSiteLinksOperations` """ api_version = self._get_api_version('vpn_site_links') if api_version == '2019-06-01': @@ -6568,6 +6873,8 @@ def vpn_site_links(self): from ..v2020_05_01.aio.operations import VpnSiteLinksOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnSiteLinksOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnSiteLinksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_site_links'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6595,6 +6902,7 @@ def vpn_sites(self): * 2020-04-01: :class:`VpnSitesOperations` * 2020-05-01: :class:`VpnSitesOperations` * 2020-06-01: :class:`VpnSitesOperations` + * 2020-07-01: :class:`VpnSitesOperations` """ api_version = self._get_api_version('vpn_sites') if api_version == '2018-04-01': @@ -6635,6 +6943,8 @@ def vpn_sites(self): from ..v2020_05_01.aio.operations import VpnSitesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnSitesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6662,6 +6972,7 @@ def vpn_sites_configuration(self): * 2020-04-01: :class:`VpnSitesConfigurationOperations` * 2020-05-01: :class:`VpnSitesConfigurationOperations` * 2020-06-01: :class:`VpnSitesConfigurationOperations` + * 2020-07-01: :class:`VpnSitesConfigurationOperations` """ api_version = self._get_api_version('vpn_sites_configuration') if api_version == '2018-04-01': @@ -6702,6 +7013,8 @@ def vpn_sites_configuration(self): from ..v2020_05_01.aio.operations import VpnSitesConfigurationOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import VpnSitesConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'vpn_sites_configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -6723,6 +7036,7 @@ def web_application_firewall_policies(self): * 2020-04-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-05-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-06-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2020-07-01: :class:`WebApplicationFirewallPoliciesOperations` """ api_version = self._get_api_version('web_application_firewall_policies') if api_version == '2018-12-01': @@ -6751,10 +7065,25 @@ def web_application_firewall_policies(self): from ..v2020_05_01.aio.operations import WebApplicationFirewallPoliciesOperations as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import WebApplicationFirewallPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_application_firewall_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def web_categories(self): + """Instance depends on the API version: + + * 2020-07-01: :class:`WebCategoriesOperations` + """ + api_version = self._get_api_version('web_categories') + if api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import WebCategoriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'web_categories'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + async def close(self): await self._client.close() async def __aenter__(self): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin.py index 84f1e9794c6cd..3aa3f32ac3a26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin.py @@ -27,7 +27,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -37,7 +37,7 @@ async def begin_delete_bastion_shareable_link( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -63,6 +63,8 @@ async def begin_delete_bastion_shareable_link( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_delete_bastion_shareable_link'".format(api_version)) mixin_instance = OperationClass() @@ -76,9 +78,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -89,7 +91,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :type virtual_wan_name: str :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation operation. - :type vpn_client_params: ~azure.mgmt.network.v2020_06_01.models.VirtualWanVpnProfileParameters + :type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -97,7 +99,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_generatevirtualwanvpnserverconfigurationvpnprofile') @@ -117,6 +119,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_generatevirtualwanvpnserverconfigurationvpnprofile'".format(api_version)) mixin_instance = OperationClass() @@ -131,7 +135,7 @@ def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -145,7 +149,7 @@ def begin_get_active_sessions( :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult]] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_get_active_sessions') @@ -163,6 +167,8 @@ def begin_get_active_sessions( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_get_active_sessions'".format(api_version)) mixin_instance = OperationClass() @@ -176,9 +182,9 @@ def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -186,7 +192,7 @@ def begin_put_bastion_shareable_link( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a @@ -194,7 +200,7 @@ def begin_put_bastion_shareable_link( :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_put_bastion_shareable_link') @@ -212,6 +218,8 @@ def begin_put_bastion_shareable_link( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'begin_put_bastion_shareable_link'".format(api_version)) mixin_instance = OperationClass() @@ -226,7 +234,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -236,7 +244,7 @@ async def check_dns_name_availability( :type domain_name_label: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DnsNameAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult + :rtype: ~azure.mgmt.network.v2020_07_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('check_dns_name_availability') @@ -300,6 +308,8 @@ async def check_dns_name_availability( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_dns_name_availability'".format(api_version)) mixin_instance = OperationClass() @@ -313,9 +323,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncItemPaged["models.BastionSessionDeleteResult"]: + ) -> AsyncItemPaged["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -323,10 +333,10 @@ def disconnect_active_sessions( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param session_ids: The list of sessionids to disconnect. - :type session_ids: ~azure.mgmt.network.v2020_06_01.models.SessionIds + :type session_ids: ~azure.mgmt.network.v2020_07_01.models.SessionIds :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('disconnect_active_sessions') @@ -344,6 +354,8 @@ def disconnect_active_sessions( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'disconnect_active_sessions'".format(api_version)) mixin_instance = OperationClass() @@ -357,9 +369,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncItemPaged["models.BastionShareableLinkListResult"]: + ) -> AsyncItemPaged["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -367,10 +379,10 @@ def get_bastion_shareable_link( :param bastion_host_name: The name of the Bastion Host. :type bastion_host_name: str :param bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_bastion_shareable_link') @@ -388,6 +400,8 @@ def get_bastion_shareable_link( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_bastion_shareable_link'".format(api_version)) mixin_instance = OperationClass() @@ -402,7 +416,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -412,7 +426,7 @@ async def supported_security_providers( :type virtual_wan_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualWanSecurityProviders, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('supported_security_providers') @@ -448,6 +462,8 @@ async def supported_security_providers( from ..v2020_05_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-06-01': from ..v2020_06_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'supported_security_providers'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py index 2d5c5c0623ef2..7dcbed35b605d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py @@ -7,4 +7,4 @@ from .v2019_02_01.models import * from .v2019_07_01.models import * from .v2020_04_01.models import * -from .v2020_06_01.models import * +from .v2020_07_01.models import * diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_metadata.json index 3b536f590d8a6..d926d400e938a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -78,7 +79,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.net zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2015_06_15.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_network_management_client.py index fd2df30a8918d..9e173ff556edf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/_network_management_client.py @@ -102,7 +102,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/_network_management_client.py index 91fa60c8e9618..de52a38f8853b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/_network_management_client.py @@ -99,7 +99,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_application_gateways_operations.py index 4d4a1e6e4939e..6908c86171eac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -645,7 +663,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_authorizations_operations.py index 8b3a6186b52db..d1421b6f84817 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_peerings_operations.py index f450189612283..cbbed51c5fe4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuits_operations.py index 8d634072df730..e9dbf228c9754 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def list_arp_table( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitsArpTableListResult"]: """The ListArpTable from ExpressRouteCircuit operation retrieves the currently advertised arp table associated with the ExpressRouteCircuits in a resource group. @@ -341,7 +353,7 @@ def list_arp_table( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsArpTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def list_routes_table( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitsRoutesTableListResult"]: """The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised routes table associated with the ExpressRouteCircuits in a resource group. @@ -416,7 +428,7 @@ def list_routes_table( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsRoutesTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitsStatsListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitsStatsListResult"]: """The ListStats ExpressRouteCircuit operation retrieves all the stats from a ExpressRouteCircuits in a resource group. @@ -491,7 +503,7 @@ def list_stats( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsStatsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsStatsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsStatsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -552,7 +564,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -621,7 +633,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -629,7 +641,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_service_providers_operations.py index cbf3b65c3c638..d394a56a633d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py index 5ffb5de75dd04..c645746f71e3d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_local_network_gateways_operations.py index 876d2e954afd3..00bfce86214c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py index be770c9466c4a..7de40ca3d491e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -485,7 +497,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -560,7 +572,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -625,7 +637,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -643,7 +655,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_management_client_operations.py index 587b9e7a84ee3..43422bbaee88b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: Optional[str] = None, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2015_06_15.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_security_groups_operations.py index 49ed6aea48a2c..687c7da803308 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -340,7 +352,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_public_ip_addresses_operations.py index bcc1ec7f8bd68..49d0acd9ed96d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_route_tables_operations.py index db3bb5f9d0de1..d40bacc9a56fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_routes_operations.py index 6324a5a619691..b0ce514c0dde9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_security_rules_operations.py index b02ae14085563..b00df07ab9842 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_subnets_operations.py index d9a293642b3fd..cb3a0ce8b61c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_usages_operations.py index 2ef4dada07d0f..0d52cfe7ba19c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateway_connections_operations.py index bd60076760fb2..10ea9ee98b5b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,10 +414,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -457,9 +469,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -483,7 +495,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -508,7 +520,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -526,10 +544,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -583,9 +601,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -608,7 +626,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -633,7 +651,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -652,7 +676,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKeyResult": + ) -> "_models.ConnectionSharedKeyResult": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -666,7 +690,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKeyResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKeyResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateways_operations.py index a56fb432e45e9..a03f6905d8566 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -397,10 +409,10 @@ async def _reset_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,9 +464,9 @@ async def begin_reset( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -475,7 +487,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -518,7 +536,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> str: cls = kwargs.pop('cls', None) # type: ClsType[str] @@ -571,7 +589,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -620,7 +638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_networks_operations.py index b6c685bd787c6..d980de4cb84e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_application_gateways_operations.py index 8ee4a605cdf04..fa2f9952d8bdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +570,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -660,7 +678,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_authorizations_operations.py index 82eb999ded5cd..5a6be128468b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_peerings_operations.py index dde1919347127..6b6542a3a2583 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuits_operations.py index 62ce133d00ead..fd709f66a4d19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list_arp_table( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitsArpTableListResult"] """The ListArpTable from ExpressRouteCircuit operation retrieves the currently advertised arp table associated with the ExpressRouteCircuits in a resource group. @@ -351,7 +363,7 @@ def list_arp_table( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsArpTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_routes_table( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitsRoutesTableListResult"] """The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised routes table associated with the ExpressRouteCircuits in a resource group. @@ -427,7 +439,7 @@ def list_routes_table( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsRoutesTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -490,7 +502,7 @@ def list_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitsStatsListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitsStatsListResult"] """The ListStats ExpressRouteCircuit operation retrieves all the stats from a ExpressRouteCircuits in a resource group. @@ -503,7 +515,7 @@ def list_stats( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitsStatsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsStatsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsStatsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -565,7 +577,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -575,7 +587,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +647,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -643,7 +655,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_service_providers_operations.py index bf5d2dd1f0830..7768d310a0e15 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_load_balancers_operations.py index a8f86a444f559..984a289636cc5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_local_network_gateways_operations.py index 6b2204f0c4e9d..98796514d9fe8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_interfaces_operations.py index 7d34a144a6d73..d4e733fbfb423 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -497,7 +509,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -561,7 +573,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -573,7 +585,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +651,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -657,7 +669,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_management_client_operations.py index e74be464b9fe5..a90939ddc4785 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2015_06_15.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_security_groups_operations.py index d5bf60fe455fe..7c838e3441360 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -350,7 +362,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_public_ip_addresses_operations.py index 8ee830330610d..39b31e9f5574e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_route_tables_operations.py index 5e4234176ae12..0b0377fc0b0ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_routes_operations.py index ea2f981f7d3b1..9a4f27900fb50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_security_rules_operations.py index 8ec148cb58576..e17d6de618892 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_subnets_operations.py index 7f1939f0f86a4..365dca94b6c47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_usages_operations.py index 57ddff57d6ed3..0bfd6b9b3dd39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateway_connections_operations.py index 79d2af25c4dda..06c9fb96139fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,11 +424,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,10 +480,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -495,7 +507,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -520,7 +532,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -538,11 +556,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -596,10 +614,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -622,7 +640,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +665,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -667,7 +691,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKeyResult" + # type: (...) -> "_models.ConnectionSharedKeyResult" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -681,7 +705,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKeyResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKeyResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateways_operations.py index c30d7d572f61e..57a5b7aee5e1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,11 +419,11 @@ def _reset_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,10 +475,10 @@ def begin_reset( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -487,7 +499,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -530,7 +548,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> str @@ -584,7 +602,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -634,7 +652,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_networks_operations.py index 1ee27bdebdc28..57289fc5d814e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_metadata.json index 6346554d07d08..399d3d04d620b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -81,7 +82,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.net zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2016_09_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_network_management_client.py index 94078e54951ca..5ec7e1bc20a35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/_network_management_client.py @@ -111,7 +111,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.network_interfaces = NetworkInterfacesOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/_network_management_client.py index 34744e388502f..fec2c4dabb355 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/_network_management_client.py @@ -108,7 +108,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.network_interfaces = NetworkInterfacesOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_application_gateways_operations.py index 7eadbfcd37bb2..39762775d530a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -645,7 +663,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,8 +689,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,7 +741,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -737,7 +761,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +786,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_authorizations_operations.py index 55b6c5fdf5432..01baa391c3d96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_peerings_operations.py index e6ead4e10c857..c769dbefcee31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuits_operations.py index f19dd84897201..40a1ca85a1ade 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,8 +342,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +395,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -406,7 +418,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,8 +473,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +526,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -529,7 +549,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +575,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,8 +604,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +657,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -652,7 +680,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +706,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,7 +733,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -709,7 +745,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -756,7 +792,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -770,7 +806,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +852,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -826,7 +862,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -885,7 +921,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -893,7 +929,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_service_providers_operations.py index 778be21b4e057..9e628a94cd2a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_load_balancers_operations.py index a7a89a8600b51..f5e00cdcc29f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_local_network_gateways_operations.py index 034ba74d6ba57..4ab43661d9a08 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_interfaces_operations.py index 98073c004d1ef..92d28e0d79a29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -64,7 +64,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -222,7 +222,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -353,7 +353,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -373,7 +379,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -434,10 +440,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -491,9 +497,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -538,7 +544,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -555,7 +567,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -563,7 +575,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -622,7 +634,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -632,7 +644,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -693,8 +705,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -742,7 +754,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -784,7 +796,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -803,8 +821,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -852,7 +870,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -870,7 +888,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_management_client_operations.py index a86409f5042ff..70ff849c7c9a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: Optional[str] = None, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2016_09_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_security_groups_operations.py index dee25f8fa4e1e..af314c70b75a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -340,7 +352,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_watchers_operations.py index 7855d5adf333d..e9a52e6075487 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +281,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +350,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -352,7 +358,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,9 +417,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -427,7 +433,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2016_09_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,10 +483,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,9 +540,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -556,7 +562,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -581,7 +587,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -599,10 +611,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,9 +668,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -678,7 +690,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -703,7 +715,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -721,10 +739,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -778,9 +796,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -800,7 +818,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -825,7 +843,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -843,10 +867,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,9 +924,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -922,7 +946,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -947,7 +971,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -965,10 +995,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,9 +1052,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1044,7 +1074,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1069,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1087,10 +1123,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,9 +1180,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1166,7 +1202,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1191,7 +1227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1209,10 +1251,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1266,9 +1308,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1288,7 +1330,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1313,7 +1355,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_packet_captures_operations.py index d05d94401b623..1dfc9e7c4b19b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_public_ip_addresses_operations.py index dc73e3ec03f27..205a60bed47c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_route_tables_operations.py index 73c28179ea2d1..44c3d48a1e3c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_routes_operations.py index b5a3aebee8d17..f309eb0ce0a62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_security_rules_operations.py index 2b8a639ec6c26..dc51f3eddfe1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_subnets_operations.py index 47f05b9215b56..7b7bd71a9fd8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_usages_operations.py index 096744cb610df..8b72d2e78b621 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateway_connections_operations.py index 212d540a85463..01db17ee83696 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -413,7 +425,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -471,7 +489,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2016_09_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,10 +605,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,9 +660,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -668,7 +686,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateways_operations.py index d6644b4baa647..c68ed65c7fa69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,8 +411,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -497,7 +509,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -515,7 +533,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> str: cls = kwargs.pop('cls', None) # type: ClsType[str] @@ -568,7 +586,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -617,7 +635,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -637,8 +661,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,7 +713,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -709,7 +733,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -734,7 +758,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -753,8 +783,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -802,7 +832,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -821,7 +851,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -845,7 +875,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -865,8 +901,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -916,7 +952,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -937,7 +973,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +998,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_peerings_operations.py index d20494af76543..2042fc8f1c4ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_networks_operations.py index dee7604a4ea80..3665e2f0523e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2016_09_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_application_gateways_operations.py index 9de1dcd7533c0..a65c9a1380935 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +570,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -660,7 +678,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -681,8 +705,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -734,7 +758,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -754,7 +778,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -779,7 +803,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_authorizations_operations.py index c1b38c30118d5..d9d75432d939e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_peerings_operations.py index a4aedc97b5c4c..eab5902dad061 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuits_operations.py index 73f9e9a2251e1..7a2fd63f5282f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,8 +352,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -417,7 +429,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,8 +485,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +539,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -542,7 +562,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -568,7 +588,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,8 +618,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -644,7 +672,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -667,7 +695,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +721,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,7 +749,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -725,7 +761,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,7 +809,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -787,7 +823,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,7 +870,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -844,7 +880,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -904,7 +940,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -912,7 +948,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_service_providers_operations.py index e044f0aebf0b4..f44fd82fb56c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_load_balancers_operations.py index 57986197758f9..3a2b8d1a215c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_local_network_gateways_operations.py index f02820af40f66..a988170c2468f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_interfaces_operations.py index f7fa25e2e9666..ca037d7b5965e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -69,7 +69,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -133,7 +133,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -229,7 +229,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -362,7 +362,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -383,7 +389,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -397,7 +403,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -444,11 +450,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -502,10 +508,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -525,7 +531,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +556,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -568,7 +580,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -576,7 +588,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +648,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -646,7 +658,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -708,8 +720,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -758,7 +770,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -776,7 +788,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -800,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -820,8 +838,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -870,7 +888,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -888,7 +906,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -912,7 +930,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_management_client_operations.py index f1e60913645b5..e2f3fb091e8fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2016_09_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_security_groups_operations.py index 7b6197b6d6581..4876a406bb1b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -350,7 +362,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_watchers_operations.py index 15546c4df84c1..90d94af35d22d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +290,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +360,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -362,7 +368,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,10 +427,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -438,7 +444,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2016_09_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,11 +494,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,10 +552,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -569,7 +575,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -594,7 +600,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -612,11 +624,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,10 +682,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -693,7 +705,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -718,7 +730,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -736,11 +754,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,10 +812,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -817,7 +835,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -842,7 +860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -860,11 +884,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -918,10 +942,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -941,7 +965,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -966,7 +990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -984,11 +1014,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1042,10 +1072,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1065,7 +1095,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1090,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1108,11 +1144,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1166,10 +1202,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1189,7 +1225,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1214,7 +1250,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1232,11 +1274,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1290,10 +1332,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1313,7 +1355,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_packet_captures_operations.py index 1b080cfc80086..487d6e9904b5a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_public_ip_addresses_operations.py index 4dab4b06e58a4..e01a61a061ac5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_route_tables_operations.py index 811fe9b49d7d3..e4cd7a0c0c8e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_routes_operations.py index 3cf354a164b5e..6cae563175065 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_security_rules_operations.py index b01ced8a6dc10..dc313e304343c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_subnets_operations.py index fbe7b7a3f88ee..161312d56956c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_usages_operations.py index abcee787cb77b..a917583952736 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateway_connections_operations.py index 0fae7e53a89d8..a110ba16b4f79 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -424,7 +436,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -483,7 +501,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2016_09_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,11 +618,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,10 +674,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -683,7 +701,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateways_operations.py index f64d798735ad9..ca0e6ef08a7fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,8 +422,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -509,7 +521,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -527,7 +545,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> str @@ -581,7 +599,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -631,7 +649,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -652,8 +676,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -705,7 +729,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -725,7 +749,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -750,7 +774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -770,8 +800,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,7 +850,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -839,7 +869,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -863,7 +893,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -884,8 +920,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +972,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -957,7 +993,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1018,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_peerings_operations.py index 3da808f34f3d4..af2cebba1d42a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_networks_operations.py index 5d3a5af4e08bd..125499d1b492f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -496,7 +508,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2016_09_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_metadata.json index 2b4c9af3992e2..b3b8643e63353 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -84,7 +85,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.net zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2016_12_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_network_management_client.py index f26611b4d31f1..7f349584e7900 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/_network_management_client.py @@ -120,7 +120,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.network_interfaces = NetworkInterfacesOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/_network_management_client.py index c00982e32d9af..2e6ae4d1da9f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/_network_management_client.py @@ -117,7 +117,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.network_interfaces = NetworkInterfacesOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_application_gateways_operations.py index a105388a76e03..5a280e5e02ba1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -645,7 +663,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,8 +689,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,7 +741,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -737,7 +761,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +786,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_bgp_service_communities_operations.py index ba6ca17d58547..e1bcf55db6366 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_authorizations_operations.py index 90b6a4275600a..432e020c443c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_peerings_operations.py index 6df85cee4d930..0d3f4398afd69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuits_operations.py index a14437fdd9aee..2a1f5b8160cb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,8 +342,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +395,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -406,7 +418,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,8 +473,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +526,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -529,7 +549,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +575,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,8 +604,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +657,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -652,7 +680,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +706,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,7 +733,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -709,7 +745,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -756,7 +792,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -770,7 +806,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +852,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -826,7 +862,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -885,7 +921,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -893,7 +929,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_service_providers_operations.py index 84a907e94623b..f846d994361cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_load_balancers_operations.py index 70e52d8d928a0..c4deae5e0cccc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_local_network_gateways_operations.py index fb152cf2dda35..4f7be14ed18e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_interfaces_operations.py index 9ef6e8042d46d..bb911f4a94c19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -64,7 +64,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -222,7 +222,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -353,7 +353,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -373,7 +379,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -434,10 +440,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -491,9 +497,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -538,7 +544,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -555,7 +567,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -563,7 +575,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -622,7 +634,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -632,7 +644,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -693,8 +705,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -742,7 +754,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -784,7 +796,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -803,8 +821,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -852,7 +870,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -870,7 +888,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_management_client_operations.py index 5a4de106a5788..a31a8bd55d0b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: Optional[str] = None, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2016_12_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_security_groups_operations.py index 68b2ae721e34a..f5cab535d1461 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -340,7 +352,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_watchers_operations.py index 312d931564149..818bd0badae8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +281,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +350,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -352,7 +358,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,9 +417,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -427,7 +433,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2016_12_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,10 +483,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,9 +540,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -556,7 +562,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -581,7 +587,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -599,10 +611,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,9 +668,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -678,7 +690,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -703,7 +715,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -721,10 +739,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -778,9 +796,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -800,7 +818,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -825,7 +843,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -843,10 +867,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,9 +924,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -922,7 +946,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -947,7 +971,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -965,10 +995,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,9 +1052,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1044,7 +1074,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1069,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1087,10 +1123,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,9 +1180,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1166,7 +1202,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1191,7 +1227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1209,10 +1251,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1266,9 +1308,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1288,7 +1330,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1313,7 +1355,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_packet_captures_operations.py index 36e143a908b92..0a4e5114c1379 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_public_ip_addresses_operations.py index 5a0bb86980527..9f4566c238dfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filter_rules_operations.py index d984c6d8686bb..c40005f174760 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filters_operations.py index e1530687caa72..3e57224361726 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_tables_operations.py index ae6c726a56b02..75fc36744fa1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_routes_operations.py index b71915cff9fec..7a791c35855e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_security_rules_operations.py index 97c20e61694fb..fecc308191ea2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_subnets_operations.py index 1d14ad841721c..1dd3539bf9d60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_usages_operations.py index f064126ddd0cc..a3c84c4c416da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateway_connections_operations.py index 25c43d1a2d450..45af58e466853 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -413,7 +425,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -471,7 +489,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2016_12_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,10 +605,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,9 +660,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -668,7 +686,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateways_operations.py index e96affea01f5a..3106ca7a96f23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,8 +411,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -497,7 +509,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -515,7 +533,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> str: cls = kwargs.pop('cls', None) # type: ClsType[str] @@ -568,7 +586,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -617,7 +635,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -637,8 +661,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,7 +713,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -709,7 +733,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -734,7 +758,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -753,8 +783,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -802,7 +832,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -821,7 +851,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -845,7 +875,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -865,8 +901,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -916,7 +952,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -937,7 +973,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +998,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_peerings_operations.py index 0bee8fc34b2dc..385871ffd845d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_networks_operations.py index 4309aeed4bf62..657bede82a5eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2016_12_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_application_gateways_operations.py index 4e8f0d2293e5b..434bec143ee97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +570,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -660,7 +678,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -681,8 +705,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -734,7 +758,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -754,7 +778,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -779,7 +803,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_bgp_service_communities_operations.py index 86fd1bd29434c..e42b2ac8a5b8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_authorizations_operations.py index 248f30fd207de..369181434dd22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_peerings_operations.py index 8c3ee87eb46b4..904f2e962eb17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuits_operations.py index 1a060852bb8ee..2281a11a31f76 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,8 +352,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -417,7 +429,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,8 +485,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +539,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -542,7 +562,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -568,7 +588,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,8 +618,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -644,7 +672,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -667,7 +695,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +721,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,7 +749,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -725,7 +761,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,7 +809,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -787,7 +823,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,7 +870,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -844,7 +880,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -904,7 +940,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -912,7 +948,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_service_providers_operations.py index 1c896cf0b758b..913d1cc4c663a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_load_balancers_operations.py index 2e2eae231b486..bc0b5d3ee04ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_local_network_gateways_operations.py index 7262e7bc4a8b8..1b1996d9030ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_interfaces_operations.py index 3d80185325387..bbca4b73e3cb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -69,7 +69,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -133,7 +133,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -229,7 +229,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -362,7 +362,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -383,7 +389,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -397,7 +403,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -444,11 +450,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -502,10 +508,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -525,7 +531,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +556,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -568,7 +580,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -576,7 +588,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +648,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -646,7 +658,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -708,8 +720,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -758,7 +770,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -776,7 +788,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -800,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -820,8 +838,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -870,7 +888,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -888,7 +906,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -912,7 +930,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_management_client_operations.py index 6d09bc0332b31..551d009cbd82b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2016_12_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_security_groups_operations.py index 113adbd340898..dbd6a553a4784 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -350,7 +362,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_watchers_operations.py index df45b5c3e3326..38d405615848a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +290,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +360,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -362,7 +368,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,10 +427,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -438,7 +444,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2016_12_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,11 +494,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,10 +552,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -569,7 +575,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -594,7 +600,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -612,11 +624,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,10 +682,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -693,7 +705,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -718,7 +730,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -736,11 +754,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,10 +812,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -817,7 +835,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -842,7 +860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -860,11 +884,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -918,10 +942,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -941,7 +965,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -966,7 +990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -984,11 +1014,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1042,10 +1072,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1065,7 +1095,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1090,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1108,11 +1144,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1166,10 +1202,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1189,7 +1225,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1214,7 +1250,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1232,11 +1274,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1290,10 +1332,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1313,7 +1355,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_packet_captures_operations.py index cd9da844e88c5..fd39780f83b2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_public_ip_addresses_operations.py index 6838a8c92063a..a89c1aae719ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filter_rules_operations.py index f3a7129ebd1c2..625e74f5afd4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filters_operations.py index 10100d1bf3d18..f2f306cbf1fd1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_tables_operations.py index 9af2c8e3f00b7..9659980d55a67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_routes_operations.py index bb590e01fc616..361921f0fcc2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_security_rules_operations.py index 773bf8364daf7..ef1f854e82399 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_subnets_operations.py index 8c2ca2dea61af..b14e638d89b26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_usages_operations.py index 34f78fd8195c5..5a51df25b5d65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateway_connections_operations.py index e189aff7680da..26af0a0219811 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -424,7 +436,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -483,7 +501,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2016_12_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,11 +618,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,10 +674,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -683,7 +701,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateways_operations.py index a4e0a2bb7b3e9..3bb4f759d2e52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,8 +422,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -509,7 +521,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -527,7 +545,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> str @@ -581,7 +599,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -631,7 +649,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -652,8 +676,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -705,7 +729,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -725,7 +749,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -750,7 +774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -770,8 +800,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,7 +850,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -839,7 +869,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -863,7 +893,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -884,8 +920,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +972,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -957,7 +993,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1018,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_peerings_operations.py index ab178d3d8759a..36788e5019545 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_networks_operations.py index 37007c3d1b5bb..34e15434f3302 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -496,7 +508,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2016_12_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_metadata.json index c7e125a6272a2..47bd2b40d8fae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -84,7 +85,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.net zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_03_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_network_management_client.py index 769c5718e2d7f..97d4247a80c23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/_network_management_client.py @@ -120,7 +120,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/_network_management_client.py index f78f6c257e869..fa7a54f13ea34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/_network_management_client.py @@ -117,7 +117,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_application_gateways_operations.py index 0fe1ef53ee695..5b4623179f9b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -645,7 +663,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,8 +689,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,7 +741,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -737,7 +761,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +786,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -779,7 +809,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -787,7 +817,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_bgp_service_communities_operations.py index 5894bebf0c66f..808187803f2bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_authorizations_operations.py index 1ef54eca37304..0da6f492c0b07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_peerings_operations.py index 512a741977eb0..bb1a1ae712825 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuits_operations.py index 0510a3edcde4f..9c4e9b712d9aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,8 +342,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +395,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -406,7 +418,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,8 +473,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +526,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -529,7 +549,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +575,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,8 +604,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +657,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -652,7 +680,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +706,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,7 +733,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -709,7 +745,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -756,7 +792,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -770,7 +806,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +852,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -826,7 +862,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -885,7 +921,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -893,7 +929,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_service_providers_operations.py index 450cca6d1d2c8..734f430da3d62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_load_balancers_operations.py index e0d14ef390d3d..f2916f86545e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_local_network_gateways_operations.py index 1cd02f7982a49..b242db222b245 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_interfaces_operations.py index 5ada2c819ffb4..632978fb737a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,8 +481,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +530,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -536,7 +548,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -560,7 +572,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -579,8 +597,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +646,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -646,7 +664,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +688,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -690,7 +714,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -705,7 +729,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -768,7 +792,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -780,7 +804,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -845,7 +869,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -863,7 +887,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_management_client_operations.py index aeaab240b7b3d..69934bfaa5357 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: Optional[str] = None, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_03_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_security_groups_operations.py index 209b411c9befd..d19d1b6147a06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -340,7 +352,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_watchers_operations.py index 5c46f241d08e8..c5112a0d85a31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +281,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +350,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -352,7 +358,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,9 +417,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -427,7 +433,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2017_03_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,10 +483,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,9 +540,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -556,7 +562,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -581,7 +587,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -599,10 +611,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,9 +668,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -678,7 +690,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -703,7 +715,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -721,10 +739,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -778,9 +796,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -800,7 +818,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -825,7 +843,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -843,10 +867,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,9 +924,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -922,7 +946,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -947,7 +971,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -965,10 +995,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,9 +1052,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1044,7 +1074,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1069,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1087,10 +1123,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,9 +1180,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1166,7 +1202,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1191,7 +1227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1209,10 +1251,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1266,9 +1308,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1288,7 +1330,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1313,7 +1355,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1331,10 +1379,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,9 +1436,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1411,7 +1459,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1436,7 +1484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_packet_captures_operations.py index 675faff68276d..8af7d068ab9e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_public_ip_addresses_operations.py index c1f6990b27d4c..dd7b01ed64746 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -481,7 +493,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,7 +558,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -565,7 +577,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +647,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -657,7 +669,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filter_rules_operations.py index 9cef0e17ba389..7f6e2d0a1ddf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filters_operations.py index bff7cd0ed5375..dfad835960435 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_tables_operations.py index ed70bbc082f4f..36083f61ce27a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_routes_operations.py index 18097962997aa..3a020f173a934 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_security_rules_operations.py index 2ad6af949c8ca..a5f1082caa469 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_subnets_operations.py index 341980effac6f..f2b640f8479de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_usages_operations.py index 2c8c2ad07f673..f2d69675feae0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateway_connections_operations.py index 3d9a66d67b2e1..ffa0de21b7816 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -413,7 +425,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -471,7 +489,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2017_03_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,10 +605,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,9 +660,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -668,7 +686,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateways_operations.py index 2bf92f5f170bb..13e23acafdcf3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,8 +411,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -497,7 +509,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -515,7 +533,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> str: cls = kwargs.pop('cls', None) # type: ClsType[str] @@ -568,7 +586,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -617,7 +635,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -637,8 +661,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,7 +713,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -709,7 +733,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -734,7 +758,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -753,8 +783,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -802,7 +832,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -821,7 +851,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -845,7 +875,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -865,8 +901,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -916,7 +952,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -937,7 +973,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +998,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_peerings_operations.py index fa010e3995400..80e330b1fd79f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_networks_operations.py index 5c005600f3d14..72d2e45638501 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_03_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +544,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -544,7 +556,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_application_gateways_operations.py index 2dab0367d8532..11088c15672aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +570,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -660,7 +678,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -681,8 +705,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -734,7 +758,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -754,7 +778,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -779,7 +803,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -797,7 +827,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -805,7 +835,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_bgp_service_communities_operations.py index f3c6eac9ecedb..3eb007b4e44fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_authorizations_operations.py index b7d8c6b295594..dea23dc34bbfa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_peerings_operations.py index 6a1bc80398af4..1f01c78d68d90 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuits_operations.py index cbf5f4c37791d..4e6b5c213be11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,8 +352,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -417,7 +429,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,8 +485,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +539,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -542,7 +562,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -568,7 +588,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,8 +618,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -644,7 +672,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -667,7 +695,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +721,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,7 +749,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -725,7 +761,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,7 +809,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -787,7 +823,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,7 +870,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -844,7 +880,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -904,7 +940,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -912,7 +948,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_service_providers_operations.py index 380f3c9bbf454..688fb51eda324 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_load_balancers_operations.py index 8c6da2f5c865a..9967cf143b2eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_local_network_gateways_operations.py index 03d03ab3f8308..6d0caeeff8dc8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_interfaces_operations.py index 83c94f1a2b8c0..d8e80d0ab6a77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,8 +493,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -573,7 +585,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -593,8 +611,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -685,7 +703,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -706,7 +730,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -721,7 +745,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -785,7 +809,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -797,7 +821,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -863,7 +887,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -881,7 +905,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_management_client_operations.py index f0a41433247e5..5ed138c49492e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_03_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_security_groups_operations.py index b5f5a894e840c..0dbf0ed475c29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -350,7 +362,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_watchers_operations.py index 0f8ba67dd807d..5a030ba50e085 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +290,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +360,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -362,7 +368,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,10 +427,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -438,7 +444,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2017_03_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,11 +494,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,10 +552,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -569,7 +575,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -594,7 +600,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -612,11 +624,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,10 +682,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -693,7 +705,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -718,7 +730,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -736,11 +754,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,10 +812,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -817,7 +835,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -842,7 +860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -860,11 +884,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -918,10 +942,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -941,7 +965,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -966,7 +990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -984,11 +1014,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1042,10 +1072,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1065,7 +1095,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1090,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1108,11 +1144,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1166,10 +1202,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1189,7 +1225,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1214,7 +1250,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1232,11 +1274,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1290,10 +1332,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1313,7 +1355,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1356,11 +1404,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1414,10 +1462,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1438,7 +1486,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_packet_captures_operations.py index 47b795e033f97..5ff4b0b1067e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_public_ip_addresses_operations.py index c8d36fd9d1837..ac39dfa973cd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -493,7 +505,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -559,7 +571,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -578,7 +590,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +661,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -671,7 +683,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filter_rules_operations.py index dd7cb539167dc..b7a4e2f10a6e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filters_operations.py index e5f6e1f2320dd..e185eb36d83d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_tables_operations.py index 5e86219502bbf..6ca89fc8828c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_routes_operations.py index f521d3c5301a6..31bf331d063c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_security_rules_operations.py index bc367d622de29..1e3ece99e221d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_subnets_operations.py index cbfc742677122..2437307fa06ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_usages_operations.py index 993ca2b0c3a60..7bfaed01856c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateway_connections_operations.py index 7088243af2ab3..077fb83161757 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -424,7 +436,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -483,7 +501,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2017_03_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,11 +618,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,10 +674,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -683,7 +701,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateways_operations.py index 14855ea69969c..36864af04578a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,8 +422,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -509,7 +521,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -527,7 +545,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> str @@ -581,7 +599,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -631,7 +649,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -652,8 +676,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -705,7 +729,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -725,7 +749,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -750,7 +774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -770,8 +800,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,7 +850,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -839,7 +869,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -863,7 +893,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -884,8 +920,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +972,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -957,7 +993,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1018,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_peerings_operations.py index fab92425c05ba..569c61135e972 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_networks_operations.py index 231dbe3cb6010..f6f5e8631e3c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -496,7 +508,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_03_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -557,7 +569,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_metadata.json index 9a82f90eb585b..5ae7b8fe724ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -94,7 +95,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.net zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_06_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_network_management_client.py index fbb40d8f93757..38761bc9bdaef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/_network_management_client.py @@ -150,7 +150,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/_network_management_client.py index 96edcfebbad55..1a66d5b08eead 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/_network_management_client.py @@ -147,7 +147,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_application_gateways_operations.py index 99628711e1963..1e293cebabe64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -645,7 +663,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,8 +689,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,7 +741,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -737,7 +761,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +786,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -779,7 +809,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -787,7 +817,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -829,7 +859,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -837,7 +867,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,7 +909,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -887,7 +917,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -946,7 +976,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -956,7 +986,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_available_endpoint_services_operations.py index fbe336ce381db..1684f0418088b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_bgp_service_communities_operations.py index 54af210479085..5fb870d139844 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_default_security_rules_operations.py index bcd071e8e990d..f7561a19e81f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py index d8f3c91d7436e..46909f4d4430e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_peerings_operations.py index fe0edbcc5711c..0cc2a099355f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuits_operations.py index 1b584ba4d796c..2743d983732fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,8 +342,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +395,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -406,7 +418,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,8 +473,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +526,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -529,7 +549,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +575,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,8 +604,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +657,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -652,7 +680,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +706,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,7 +733,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -709,7 +745,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -756,7 +792,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -770,7 +806,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +852,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -826,7 +862,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -885,7 +921,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -893,7 +929,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_service_providers_operations.py index 97c588d841cf8..b6b367d807595 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_inbound_nat_rules_operations.py index 36ff3ef42d8b6..bc076576a4862 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 1dba373b8b8f5..91157507e9a16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 86cbb023e22e0..dbf8a9dc7193f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 8f400db6ec667..e6e31f9a84468 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_network_interfaces_operations.py index 5aa624b08ab11..0f7d8c9e46ccc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_probes_operations.py index c4cff7fb6d751..57a5a3b7cec9a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancers_operations.py index bbdf312d3aeac..56c4858d956d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_local_network_gateways_operations.py index 6436167a8a62a..0babe3cd6d8a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_ip_configurations_operations.py index 2e9a8b66dcf9b..f9c3a36f543de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_load_balancers_operations.py index 40c79f3c93bb8..d3b2d602d997b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """Get all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interfaces_operations.py index 314afbd9fea50..7b286acd8a6a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,8 +481,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +530,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -536,7 +548,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -560,7 +572,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -579,8 +597,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +646,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -646,7 +664,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +688,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -690,7 +714,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -705,7 +729,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -768,7 +792,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -780,7 +804,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -845,7 +869,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -863,7 +887,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_management_client_operations.py index b9fcdd51c237a..83f05323f80ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: Optional[str] = None, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_security_groups_operations.py index be6968c83baff..ad5b80f131ffa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -340,7 +352,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_watchers_operations.py index 048588b4cc349..8ce5fb65f1c6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +281,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +350,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -352,7 +358,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,9 +417,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -427,7 +433,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2017_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,10 +483,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,9 +540,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -556,7 +562,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -581,7 +587,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -599,10 +611,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,9 +668,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -678,7 +690,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -703,7 +715,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -721,10 +739,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -778,9 +796,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -800,7 +818,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -825,7 +843,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -843,10 +867,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,9 +924,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -922,7 +946,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -947,7 +971,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -965,10 +995,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,9 +1052,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1044,7 +1074,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1069,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1087,10 +1123,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,9 +1180,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1166,7 +1202,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1191,7 +1227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1209,10 +1251,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1266,9 +1308,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1288,7 +1330,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1313,7 +1355,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1331,10 +1379,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,9 +1436,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1411,7 +1459,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1436,7 +1484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_packet_captures_operations.py index 9082fef55f37d..0bebe205a8aa6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_public_ip_addresses_operations.py index fa5c8d1af8209..44fe456be982b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -481,7 +493,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,7 +558,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -565,7 +577,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +647,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -657,7 +669,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filter_rules_operations.py index f2cffaf612449..8926c54812aa2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filters_operations.py index 8687927770453..14fad5b98dbcb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_tables_operations.py index f074d3944ab41..bed4dd8e63065 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py index f73f6cb1402e5..1d8e63b3d8416 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_security_rules_operations.py index f4496e3d74fec..08adf9573e4eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_subnets_operations.py index 24f34e8f2b213..783ba6dad8800 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_usages_operations.py index 4ac97238e1572..a36a523442a80 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateway_connections_operations.py index ff12c303ea574..dbdfca0eef3fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -413,7 +425,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -471,7 +489,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2017_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,10 +605,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,9 +660,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -668,7 +686,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateways_operations.py index 76a15b76a57e0..1607b7c59841d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,8 +485,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +537,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -546,7 +558,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -571,7 +583,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +607,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -644,7 +662,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -711,7 +735,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> str: cls = kwargs.pop('cls', None) # type: ClsType[str] @@ -764,7 +788,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -833,8 +863,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -885,7 +915,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -905,7 +935,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -930,7 +960,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -949,8 +985,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -998,7 +1034,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1017,7 +1053,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1041,7 +1077,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1061,8 +1103,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1112,7 +1154,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1133,7 +1175,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1158,7 +1200,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_peerings_operations.py index 79483625adcec..eeaefd9b650af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_networks_operations.py index 331af9d155ee9..552aef53dfce5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +544,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -544,7 +556,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_application_gateways_operations.py index b20327a264a41..f8925e8305c0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +570,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -660,7 +678,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -681,8 +705,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -734,7 +758,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -754,7 +778,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -779,7 +803,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -797,7 +827,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -805,7 +835,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -848,7 +878,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -856,7 +886,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -899,7 +929,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -907,7 +937,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -967,7 +997,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -977,7 +1007,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_available_endpoint_services_operations.py index e77717eeaa9bb..99694d5723ffb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_bgp_service_communities_operations.py index d7e496b9e8f01..671a890c7d2f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_default_security_rules_operations.py index fb96283c5d7c5..ac837c556e05b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_authorizations_operations.py index bd5b2180596ea..8064e8b06cecc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_peerings_operations.py index cc95bc0fda239..8aabf2888061d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuits_operations.py index b06fc902dfbf7..543e1df3b333b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,8 +352,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -417,7 +429,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,8 +485,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +539,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -542,7 +562,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -568,7 +588,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,8 +618,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -644,7 +672,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -667,7 +695,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +721,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,7 +749,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -725,7 +761,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,7 +809,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -787,7 +823,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,7 +870,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -844,7 +880,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -904,7 +940,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -912,7 +948,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_service_providers_operations.py index d77153c9bfb58..16eada3fcf230 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_inbound_nat_rules_operations.py index 2e5f9fed27d53..604a7eb0ac5aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_backend_address_pools_operations.py index 210b7052525ed..7f85b08a9ae27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 7966a20110b15..c577d63cbd835 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_load_balancing_rules_operations.py index e7b3a75250f9d..9849901f98d2d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_network_interfaces_operations.py index e440caa80a253..25a3cc93993b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_probes_operations.py index 6ce677e9f2899..96293094230f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancers_operations.py index c1d7a727cc0f6..8450dfa1ef3ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_local_network_gateways_operations.py index 525827f929476..04e7b3969fa65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_ip_configurations_operations.py index bfa0f168378c7..63a1348af0292 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_load_balancers_operations.py index 0c267e416d4cf..16a24121c94c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """Get all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interfaces_operations.py index 019eb9b154fa8..a271bbd58a02c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,8 +493,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -573,7 +585,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -593,8 +611,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -685,7 +703,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -706,7 +730,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -721,7 +745,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -785,7 +809,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -797,7 +821,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -863,7 +887,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -881,7 +905,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_management_client_operations.py index a28fc0b3f1583..c9772c5acdebc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.net zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py index c57d8f03a5d73..fe2b906555a82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -350,7 +362,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_watchers_operations.py index d3b455c74ee86..b4ed8c139a9c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +290,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +360,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -362,7 +368,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,10 +427,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -438,7 +444,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2017_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,11 +494,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,10 +552,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -569,7 +575,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -594,7 +600,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -612,11 +624,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,10 +682,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -693,7 +705,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -718,7 +730,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -736,11 +754,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,10 +812,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -817,7 +835,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -842,7 +860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -860,11 +884,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -918,10 +942,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -941,7 +965,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -966,7 +990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -984,11 +1014,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1042,10 +1072,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1065,7 +1095,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1090,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1108,11 +1144,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1166,10 +1202,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1189,7 +1225,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1214,7 +1250,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1232,11 +1274,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1290,10 +1332,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1313,7 +1355,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1356,11 +1404,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1414,10 +1462,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1438,7 +1486,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_packet_captures_operations.py index 396a6bc041ad7..58a1c13fa28a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_public_ip_addresses_operations.py index 9f810517fb04b..4fb96a347b61a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -493,7 +505,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -559,7 +571,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -578,7 +590,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +661,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -671,7 +683,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filter_rules_operations.py index 90b6b3ceccbda..a6eda5314cef7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filters_operations.py index 41ae57500e622..ddfd314099606 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_tables_operations.py index 87b65466a29ae..ec9fb656ddd6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_routes_operations.py index f37d72cf05ffd..f872ecf5b13d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_security_rules_operations.py index 59e50c8529f37..acea63ce83e00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py index 4d9561fed751d..f7157d354d862 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_usages_operations.py index f862f787e9a6d..221a16414522c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """Lists compute usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateway_connections_operations.py index 5dfec676ead41..6c4f935683c46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -424,7 +436,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -483,7 +501,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2017_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,11 +618,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,10 +674,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -683,7 +701,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateways_operations.py index 249e3ac6a7ca3..b09bd89dbaa2d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,8 +497,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -559,7 +571,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -602,7 +620,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -658,7 +676,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -726,7 +750,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> str @@ -780,7 +804,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -830,7 +854,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,8 +881,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -904,7 +934,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -924,7 +954,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -949,7 +979,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -969,8 +1005,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1038,7 +1074,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1062,7 +1098,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1083,8 +1125,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1135,7 +1177,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1156,7 +1198,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1181,7 +1223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_peerings_operations.py index 4b0e2a5936fcd..f230199624f56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_networks_operations.py index 2b3ff5df69a0b..45a3b3c13f4f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -496,7 +508,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -557,7 +569,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json index 210eaa4d0cb5e..4399b533280bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -94,7 +95,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py index d13cc7ffe621e..ac3b68dfd80c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py @@ -150,7 +150,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py index 4fc59bb2c92e2..cd002b50fcd88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py @@ -147,7 +147,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py index 1567fbd899eec..a213ed38487ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -645,7 +663,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,8 +689,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -717,7 +741,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -737,7 +761,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +786,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -779,7 +809,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -787,7 +817,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -829,7 +859,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -837,7 +867,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,7 +909,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -887,7 +917,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -946,7 +976,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -956,7 +986,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py index c7f7b090ccf3b..3cd8b6d1d245f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py index 432e88d6cec63..c28c936065ef7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py index 0c94de927c9e0..16865342f541d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py index 40d2a88e15dd1..2c16dde8e8fc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py index 1f02cb578a383..b8fddcfd11ca8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py index de96910b26240..cd3dc10d9fb74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,8 +342,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +395,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -406,7 +418,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,8 +473,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +526,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -529,7 +549,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +575,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,8 +604,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +657,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -652,7 +680,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +706,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,7 +733,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -709,7 +745,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -756,7 +792,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -770,7 +806,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +852,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -826,7 +862,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -885,7 +921,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -893,7 +929,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py index e690dd73ebab0..3a5816d8596a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py index dd411b3ccad82..4f4fa87207aae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 08f405d2f06db..23d1b8ffa618c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 0fdd4dc0bce41..975d61135a7fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index e7f2a3123be40..106152a6778a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py index c01d146e29528..e0d67fa75f22b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py index bdad2d150b4d9..2af0640ab9df0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py index a598cd637c458..b566537a96f60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py index 7c69157305c5d..f5cabef4ba75b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py index 60eb1dda41853..268ec1aa659ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py index 5907530c9e4ec..34afacbe878ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py index 1da3f6a8219ad..ef0d266489df2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,8 +481,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +530,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -536,7 +548,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -560,7 +572,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -579,8 +597,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +646,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -646,7 +664,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +688,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -690,7 +714,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -705,7 +729,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -768,7 +792,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -780,7 +804,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -845,7 +869,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -863,7 +887,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py index 9e0f59b6d21ff..428379558401d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py index aa4e936c95165..23d03737030fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -340,7 +352,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py index 9045f60840fa9..26ec38dc71aac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +281,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +350,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -352,7 +358,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,9 +417,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -427,7 +433,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2017_08_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,10 +483,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,9 +540,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -556,7 +562,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -581,7 +587,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -599,10 +611,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,9 +668,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -678,7 +690,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -703,7 +715,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -721,10 +739,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -778,9 +796,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -800,7 +818,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -825,7 +843,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -843,10 +867,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,9 +924,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -922,7 +946,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -947,7 +971,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -965,10 +995,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1022,9 +1052,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1044,7 +1074,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1069,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1087,10 +1123,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,9 +1180,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1166,7 +1202,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1191,7 +1227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1209,10 +1251,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1266,9 +1308,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1288,7 +1330,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1313,7 +1355,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1331,10 +1379,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,9 +1436,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1411,7 +1459,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1436,7 +1484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py index 95b4063c827c2..cefec2e12864b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py index fb7e888858892..2858ca3334a3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -481,7 +493,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,7 +558,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -565,7 +577,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +647,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -657,7 +669,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py index 279f59c59134f..9c93bfef47655 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py index ca931e8ab392c..fb9394973ae44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py index a4f183af814fd..618722f729ba9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py index 1f5e8e7f62028..f327acb699dba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py index 3e6f4db6cabe8..2fc6baa9c1a57 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py index 8681e2721efac..271a12e205e97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py index 825bd1e7acb95..0f77e3608dd3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py index 04d3328ab4ce7..5efa6adc1c5c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -413,7 +425,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -471,7 +489,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,10 +605,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,9 +660,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -668,7 +686,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py index 0bafacedde3d3..11b655f4ad81a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,8 +485,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +537,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -546,7 +558,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -571,7 +583,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +607,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -644,7 +662,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -711,7 +735,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -766,7 +790,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -815,7 +839,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -926,7 +956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -946,8 +982,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -998,7 +1034,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1018,7 +1054,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1043,7 +1079,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1062,8 +1104,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1111,7 +1153,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1130,7 +1172,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1154,7 +1196,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1174,8 +1222,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1225,7 +1273,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1246,7 +1294,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1271,7 +1319,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py index c23d0b57fb180..d3d8529b813ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py index 388ca8228e5ca..74cd7dcb273b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,7 +343,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -339,7 +351,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_08_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +544,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -544,7 +556,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py index 121bd3785f6a5..651b2dee1efd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +570,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -660,7 +678,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -681,8 +705,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -734,7 +758,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -754,7 +778,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -779,7 +803,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -797,7 +827,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -805,7 +835,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -848,7 +878,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -856,7 +886,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -899,7 +929,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -907,7 +937,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -967,7 +997,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -977,7 +1007,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py index 592a66e38e041..c4171bf78c42c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py index 334512220adeb..a8c648324ca8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py index 851653093f211..635960a5088e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py index a7ddd9ca46a83..d6d72739e9628 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py index 3389356e9ecfd..c5aed6fc71b33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py index 20a9a36711c50..498ac1e5a1961 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,8 +352,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -417,7 +429,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,8 +485,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +539,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -542,7 +562,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -568,7 +588,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,8 +618,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -644,7 +672,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -667,7 +695,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +721,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,7 +749,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -725,7 +761,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,7 +809,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -787,7 +823,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,7 +870,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -844,7 +880,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -904,7 +940,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -912,7 +948,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py index aa997f747749d..cdc524349dc53 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py index 28cca6bb402a6..122ce75f1d57f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py index 705f7c31860c9..a5193e1de0036 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 6bf5624fc9ff2..55d3975a5c311 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py index c9e1d648f62cf..04f974eb0bee4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py index 60568c7109fd6..efdc13f1dd7ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py index 06cfd19641adc..7e7d2d5e65c77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py index 301ce1763870f..24409f3ed3c82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py index ff60d82c47a0b..e186af74ca001 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py index 09cf4d7ff422f..0c4fb90286629 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py index 6c87e19c9bc54..195642500ea45 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py index fc40be5b593c8..43c8ebb990925 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,8 +493,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -573,7 +585,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -593,8 +611,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -685,7 +703,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -706,7 +730,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -721,7 +745,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -785,7 +809,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -797,7 +821,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -863,7 +887,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -881,7 +905,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py index 7c09abaa1e448..b493357a9e0bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py index c143f27ac65c1..44b72a406167c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -350,7 +362,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py index 6bc5363fb81d0..dbcd6757b5f82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +290,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +360,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -362,7 +368,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,10 +427,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -438,7 +444,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2017_08_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,11 +494,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,10 +552,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -569,7 +575,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -594,7 +600,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -612,11 +624,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,10 +682,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -693,7 +705,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -718,7 +730,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -736,11 +754,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,10 +812,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -817,7 +835,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -842,7 +860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -860,11 +884,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -918,10 +942,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -941,7 +965,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -966,7 +990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -984,11 +1014,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1042,10 +1072,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1065,7 +1095,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1090,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1108,11 +1144,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1166,10 +1202,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1189,7 +1225,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1214,7 +1250,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1232,11 +1274,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1290,10 +1332,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1313,7 +1355,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1356,11 +1404,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1414,10 +1462,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1438,7 +1486,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py index f73bd557f268a..e1b9d25acc82d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py index 8e1df4c16579e..051911d6ae93f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -493,7 +505,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -559,7 +571,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -578,7 +590,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +661,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -671,7 +683,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py index c97c5b337791e..66a3f78a8e55b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py index 62a7b6accd426..ecb1b469ceb87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py index ceae2898cd384..bc4d68e888584 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py index 5ce8766f17752..7fdb514f97564 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py index 677cdd9d879c9..de1ff1c0f60af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py index 27ce95b905dbc..4d6c2bc392589 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py index 89717c23f2289..86675719184e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py index 8383c37040891..c3e446daaf2ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -424,7 +436,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -483,7 +501,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,11 +618,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,10 +674,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -683,7 +701,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py index 3a102792d24d8..636beb8af3410 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,8 +497,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -559,7 +571,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -602,7 +620,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -658,7 +676,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -726,7 +750,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -782,7 +806,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -832,7 +856,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -945,7 +975,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -966,8 +1002,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1039,7 +1075,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1064,7 +1100,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1084,8 +1126,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1134,7 +1176,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1153,7 +1195,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1177,7 +1219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1198,8 +1246,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1250,7 +1298,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1271,7 +1319,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1344,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py index 8884dcd74a430..21a2d25aaa3b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py index 896629dcda7e4..a6f0837895573 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,7 +353,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -349,7 +361,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -496,7 +508,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_08_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +557,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -557,7 +569,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_metadata.json index db7bf37b89598..15ce25188de21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -96,7 +97,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_09_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_network_management_client.py index 6e1af36e4882b..092d5e9042a83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/_network_management_client.py @@ -156,7 +156,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/_network_management_client.py index f7d0d018587a1..ccfb58123a20a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/_network_management_client.py @@ -153,7 +153,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_gateways_operations.py index 6699c14504228..1571841ff495b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_security_groups_operations.py index 781bcd2e1f345..a8d69777ab242 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_available_endpoint_services_operations.py index ea08c990f130f..abc184a48368e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_bgp_service_communities_operations.py index 5a0fb451364c5..3a6998de20b7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_default_security_rules_operations.py index 41b8a6f556adb..33d72ea181d2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_authorizations_operations.py index 718862cb0d3dc..72ce15df2f29b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_peerings_operations.py index e104a9494b69d..5623d0f0b2ebf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuits_operations.py index f7c4547d2f5b8..91dd97d278814 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_service_providers_operations.py index c51523d48c53d..254341b4e52b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_inbound_nat_rules_operations.py index e226eda820b0a..29c84708cc937 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 2e4f71bdff7f1..d2221de9681d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 8939d593b4757..e8781357805d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 76c6daf8a3212..2dd50ccd01b9a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_network_interfaces_operations.py index b8b27f71c4e3e..6860715af0805 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_probes_operations.py index 5072d117a8fb6..989c4f4c4bd27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancers_operations.py index 84b83cc2cb66a..f7387fe8ee693 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_local_network_gateways_operations.py index b2914e5948bd9..17adc6caa8a6f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_ip_configurations_operations.py index edf28ac8b7c7f..a8f0d5ce69e46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_load_balancers_operations.py index efd3821996900..05d4e72f49bb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interfaces_operations.py index ba4fa20f187b2..2010201da18dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_management_client_operations.py index 5911b7bccd892..5f90b83053bfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_09_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_security_groups_operations.py index 8b08b7f3d8caf..8a70c96f53bce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_watchers_operations.py index 1d21d290c98b8..edbd51a36eee6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,9 +281,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -351,7 +357,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +416,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +424,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,9 +483,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -493,7 +499,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2017_09_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +549,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,9 +606,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -622,7 +628,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +653,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,10 +677,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,9 +734,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -744,7 +756,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -787,10 +805,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,9 +862,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -866,7 +884,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -891,7 +909,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -909,10 +933,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -966,9 +990,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -988,7 +1012,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1013,7 +1037,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1031,10 +1061,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1088,9 +1118,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1110,7 +1140,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1135,7 +1165,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1153,10 +1189,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1210,9 +1246,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1232,7 +1268,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1257,7 +1293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1275,10 +1317,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1332,9 +1374,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1354,7 +1396,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1379,7 +1421,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1397,10 +1445,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1454,9 +1502,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1477,7 +1525,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1502,7 +1550,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1520,10 +1574,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,9 +1631,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1600,7 +1654,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1625,7 +1679,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1643,10 +1703,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1700,9 +1760,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1722,7 +1782,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1747,7 +1807,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_operations.py index f8664a867a427..83d6f1bea6454 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_packet_captures_operations.py index 2209c39a5742b..e54031bb6fa6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_public_ip_addresses_operations.py index feba0af0df588..715dddf22ef85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filter_rules_operations.py index 203e6a56a572b..26974b82aa53c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filters_operations.py index 7a2a6188e4f1a..14b484fe4a686 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_tables_operations.py index 5b281b34097d1..fdf4717bc8537 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_routes_operations.py index c2d1cab5e7a79..c9920dbc74485 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_security_rules_operations.py index b004abc3ee904..3c2e14ed4bbf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_subnets_operations.py index 5102f47298e6f..6c1b56b3df4c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_usages_operations.py index 9ed41aa5aaabc..0f3db4fbb0d89 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateway_connections_operations.py index 482ba968209a2..f93999a318805 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + ) -> "_models.VirtualNetworkGatewayConnectionListEntity": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2017_09_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateways_operations.py index 9e97dca39f34b..996da6afb46e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,7 +1525,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_peerings_operations.py index 480efe79d1b50..ddadbd1161797 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_networks_operations.py index 7cb95ea787fa2..e9725ffc8c3f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_09_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_gateways_operations.py index 5a0d5ea8ed34a..f084c6cf05012 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_security_groups_operations.py index e666149d3f936..04d5ebe4c2b28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_available_endpoint_services_operations.py index 4b72ecd87de34..d99e2ed036f96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_bgp_service_communities_operations.py index 3501b52af8736..862ba9d423b6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py index 934c65512adfc..9e8bc52fd990a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_authorizations_operations.py index a56e76d760db9..0c127bebf7414 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_peerings_operations.py index b1688f7e68bbe..01aa83863bd6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuits_operations.py index 37a161982fa32..d13c29c4373b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_service_providers_operations.py index e90e03bc8c08e..55d5c60ffb1c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_inbound_nat_rules_operations.py index 8962bfbfbac83..cbab104a91201 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_backend_address_pools_operations.py index 7167c923a227f..03d587099d2d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py index d39da677ee770..a0f0bcd717120 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_load_balancing_rules_operations.py index 7512b7602434b..3584a9ce9bbd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_network_interfaces_operations.py index 33ad231a4975a..054bc6fa2e88a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_probes_operations.py index b13a352c26273..e0de95ddeea9f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancers_operations.py index 40095a849aa86..fa96b0a23dd49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_local_network_gateways_operations.py index da1e9af3d589e..4d880222d5b46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_ip_configurations_operations.py index b66702f3d3e11..cfac3ea3887a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_load_balancers_operations.py index a52780dc61dc4..4a0bb46513fad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interfaces_operations.py index 755af6319327d..343a24db174f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_management_client_operations.py index 05d00b3ac92b2..d71fa2f0438f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_09_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_security_groups_operations.py index 449ba8c685349..ea48087a4a60e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_watchers_operations.py index 532c1da767247..2d08961694fbf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,10 +289,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +357,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +427,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -429,7 +435,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,10 +494,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -505,7 +511,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2017_09_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -555,11 +561,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,10 +619,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -636,7 +642,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -661,7 +667,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -679,11 +691,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -737,10 +749,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -785,7 +797,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -803,11 +821,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,10 +879,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -884,7 +902,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -909,7 +927,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -927,11 +951,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -985,10 +1009,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1008,7 +1032,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1033,7 +1057,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1051,11 +1081,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,10 +1139,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1132,7 +1162,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1157,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1175,11 +1211,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1233,10 +1269,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1256,7 +1292,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1281,7 +1317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1299,11 +1341,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1357,10 +1399,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1380,7 +1422,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1405,7 +1447,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1423,11 +1471,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1481,10 +1529,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1505,7 +1553,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1530,7 +1578,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1548,11 +1602,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,10 +1660,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1630,7 +1684,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1655,7 +1709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1673,11 +1733,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1731,10 +1791,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1754,7 +1814,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1779,7 +1839,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_operations.py index 4b9160354a85f..3497c3b9a6b1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_packet_captures_operations.py index 734f318cc0026..f7b22664f7a4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_public_ip_addresses_operations.py index 30580424384d4..0ab7667143ca6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filter_rules_operations.py index be5082138e100..62ceb16920979 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filters_operations.py index ddaa3580d9fb4..3ee58d5c9aca1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_tables_operations.py index 9230a73018888..807777b607f2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_routes_operations.py index c947eb479c34d..3be76758c90df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_security_rules_operations.py index a1caf2de0cfd0..79323ff680175 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_subnets_operations.py index 1198d69d7f5f5..367893c7ff19b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_usages_operations.py index 484a1228fe186..726c4880c9442 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateway_connections_operations.py index 7694a5e490f03..cb97dadfa201e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnectionListEntity" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> "_models.VirtualNetworkGatewayConnectionListEntity" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2017_09_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateways_operations.py index fc99b69fabc01..a084f036f2fe3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,7 +1553,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_peerings_operations.py index 99ce8a7108340..814a2b9667b02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_networks_operations.py index 37462ba6a9064..e462894d55b12 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_09_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_metadata.json index 43f4d051d9859..70f90b2b0aeba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -97,7 +98,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_10_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_network_management_client.py index 56dd4b8488ff5..cacb6a293c1a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/_network_management_client.py @@ -159,7 +159,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/_network_management_client.py index 246556b0d2d3a..39ee337b4a129 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/_network_management_client.py @@ -156,7 +156,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_gateways_operations.py index c3ea5c9de5a15..5b03747fb6f88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_security_groups_operations.py index beed11fe541db..0e412165010ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_available_endpoint_services_operations.py index 57772f6327fdc..fcb28442e8744 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_bgp_service_communities_operations.py index 5279aa54f2006..09a12c6f6c026 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_connection_monitors_operations.py index f228973272bc6..4ed3bcfccd1dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -431,7 +445,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -537,7 +558,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -557,8 +585,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +638,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -630,7 +658,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +683,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -674,7 +709,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -686,7 +721,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_default_security_rules_operations.py index 5483d4d1f007f..79b48105387d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_authorizations_operations.py index 8588d8a77dd70..957e1a26511b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_peerings_operations.py index 537c45e90292a..197afefa5f298 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuits_operations.py index 54c9ae56f3df4..5589f6b15b60b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_service_providers_operations.py index ddce90164980f..3972143c426e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_inbound_nat_rules_operations.py index 1542119add280..5e64831cab052 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py index f5e5c4077cabc..1f45b31465fa0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 33cc9320681c4..6eb3a7a98f864 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 02cd1c42c990b..e7d75d353dac8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_network_interfaces_operations.py index fe27031a5bf68..641b593acf414 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_probes_operations.py index 27805272f23f8..4678b19d21a1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancers_operations.py index 2be894f04ade4..704e38ad59aa0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_local_network_gateways_operations.py index 7fd387974e0f7..750f0bb49646b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_ip_configurations_operations.py index 9680de45d803c..8db70571d9c5f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_load_balancers_operations.py index 2b795a1559f62..be74ee6d1d0b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interfaces_operations.py index 0d88a1ef9633d..536fbcf7f4f91 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_management_client_operations.py index 697066fabd2fe..02e123a3d866b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_10_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_security_groups_operations.py index 849e9aafceac8..8f4e47bce4b25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_watchers_operations.py index 8a43d686579b3..9f2c83c05dea0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,9 +281,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -351,7 +357,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +416,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +424,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,9 +483,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -493,7 +499,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2017_10_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +549,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,9 +606,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -622,7 +628,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +653,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,10 +677,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,9 +734,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -744,7 +756,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -787,10 +805,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,9 +862,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -866,7 +884,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -891,7 +909,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -909,10 +933,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -966,9 +990,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -988,7 +1012,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1013,7 +1037,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1031,10 +1061,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1088,9 +1118,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1110,7 +1140,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1135,7 +1165,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1153,10 +1189,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1210,9 +1246,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1232,7 +1268,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1257,7 +1293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1275,10 +1317,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1332,9 +1374,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1354,7 +1396,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1379,7 +1421,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1397,10 +1445,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1454,9 +1502,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1477,7 +1525,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1502,7 +1550,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1520,10 +1574,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,9 +1631,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1600,7 +1654,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1625,7 +1679,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1643,10 +1703,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1700,9 +1760,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1722,7 +1782,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1747,7 +1807,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_operations.py index f3c794ff7bbaa..539781875438f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_packet_captures_operations.py index 0cfcfa62f60a0..57f0292d96239 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_public_ip_addresses_operations.py index f70f256cd59a3..d065b1bdfcc07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filter_rules_operations.py index f54b5626145c1..589be135608da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filters_operations.py index ebbb775aad43e..937d4f03ddbcc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_tables_operations.py index f4541c73f5b2a..bb9970c8fac27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_routes_operations.py index 5bdaa82f67ed6..6ffaf02d5b8f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_security_rules_operations.py index d412d4bc3cae8..bf6ce2e312438 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_subnets_operations.py index a7c7b2d6f4d61..02fa9a419de4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_usages_operations.py index 06bf91d5d30ab..b9c381d5746d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateway_connections_operations.py index dbca1ea828738..1131aa1a130af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + ) -> "_models.VirtualNetworkGatewayConnectionListEntity": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateways_operations.py index da6955f3a2d35..708d046ef31bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,7 +1525,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_peerings_operations.py index 028f4f19542f5..6b4d48e5eca77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_networks_operations.py index e09629cfa147d..e525402ebd326 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_10_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_gateways_operations.py index a11fa09583be4..3ae7aa6a5cf21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_security_groups_operations.py index d38885c3ff810..12f7305c76f93 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_available_endpoint_services_operations.py index f1a4aef4c03b3..9ebd1356a55c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_bgp_service_communities_operations.py index fe050c316b753..b6b132c72ccde 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_connection_monitors_operations.py index 1ea9806edb3ed..bebc16d7437c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -442,7 +456,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -550,7 +571,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -571,8 +599,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -625,7 +653,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -645,7 +673,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +698,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -690,7 +725,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -702,7 +737,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_default_security_rules_operations.py index a12f6ba1b9a4a..0ca70f0f3b0a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_authorizations_operations.py index 4101a00d2f894..ab46f3cb294d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_peerings_operations.py index 6d5629bbf7868..e5d63d44eae12 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuits_operations.py index 1dfeb49983efd..d02a99435a9d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_service_providers_operations.py index ec6216cc3de54..6008615f2da63 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_inbound_nat_rules_operations.py index 273616dc67a95..5aec35b10beb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_backend_address_pools_operations.py index 83d56b36df2f2..8104ddf2d40a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 318237caec01d..1f2236b5f95bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_load_balancing_rules_operations.py index 26f4e4eedcd16..81261da4a2744 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_network_interfaces_operations.py index a290d9f5d8ae2..8c5488f8d11e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_probes_operations.py index c00edfdce5e06..c2093011e9f9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancers_operations.py index fcde54ff78dc1..70ea9b0a68543 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_local_network_gateways_operations.py index 400137aafd7c2..2b176663265d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_ip_configurations_operations.py index 00a1e1bd14028..9b14b2a17b6db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_load_balancers_operations.py index 6587037457843..58da443d98a75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interfaces_operations.py index 18de4c3ec2178..7a46b7d85b3c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_management_client_operations.py index aa413498d7a19..1783af213a02d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_10_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_security_groups_operations.py index ea315cd877821..94d85a212c1a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_watchers_operations.py index 911642478f0ee..162d82476b501 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,10 +289,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +357,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +427,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -429,7 +435,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,10 +494,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -505,7 +511,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2017_10_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -555,11 +561,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,10 +619,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -636,7 +642,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -661,7 +667,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -679,11 +691,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -737,10 +749,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -785,7 +797,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -803,11 +821,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,10 +879,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -884,7 +902,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -909,7 +927,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -927,11 +951,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -985,10 +1009,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1008,7 +1032,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1033,7 +1057,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1051,11 +1081,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,10 +1139,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1132,7 +1162,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1157,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1175,11 +1211,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1233,10 +1269,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1256,7 +1292,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1281,7 +1317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1299,11 +1341,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1357,10 +1399,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1380,7 +1422,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1405,7 +1447,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1423,11 +1471,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1481,10 +1529,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1505,7 +1553,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1530,7 +1578,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1548,11 +1602,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,10 +1660,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1630,7 +1684,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1655,7 +1709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1673,11 +1733,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1731,10 +1791,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1754,7 +1814,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1779,7 +1839,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_operations.py index f1cbdb622af3a..9adf7c38467b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_packet_captures_operations.py index e49d4e1af20ed..7728db4d1afb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_public_ip_addresses_operations.py index 6a99e98c93716..be53ba5ec4988 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filter_rules_operations.py index cdee0c17713a0..e56c2f2a2a128 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filters_operations.py index ffcb63a59b571..edd0f9656d837 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_tables_operations.py index 2990b9353f19f..9d9075684c709 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_routes_operations.py index 4eaf0fa18d596..3341fbd740598 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_security_rules_operations.py index f1e0f722f32c7..33bad78664cc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_subnets_operations.py index 65e7121f1696b..a63d82aadb8fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_usages_operations.py index b4b8f34f31797..13015afe512df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateway_connections_operations.py index 852d50ee21bae..5d5f8453f531e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnectionListEntity" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> "_models.VirtualNetworkGatewayConnectionListEntity" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateways_operations.py index 6bd421e45a1e9..914c98a5d1453 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,7 +1553,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_peerings_operations.py index 03485bdf0db08..0f0772acb74b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_networks_operations.py index 21ec6919eedec..3427799a24641 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_10_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_metadata.json index 4fc26bbb4cdfb..ffafe5664b266 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -97,7 +98,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_11_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_network_management_client.py index 5c90cdcf9395e..6b838faf58c33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/_network_management_client.py @@ -159,7 +159,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/_network_management_client.py index 1fdbbf615e6ea..342f814472ff4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/_network_management_client.py @@ -156,7 +156,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_gateways_operations.py index ca440ea5f3f21..f4c23a56d79bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_security_groups_operations.py index 5d3dc51524e3d..aa7b980bd7428 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_available_endpoint_services_operations.py index 6fe7f66d6afba..d0f38daead3e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_bgp_service_communities_operations.py index 42f51c68e3bb1..c6e0aed80ff39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_connection_monitors_operations.py index 7ac6bb37f2ea7..d70177793245f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -431,7 +445,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -537,7 +558,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -557,8 +585,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +638,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -630,7 +658,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +683,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -674,7 +709,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -686,7 +721,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_default_security_rules_operations.py index 3ea7f87524c3d..fa7cc596f9860 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_authorizations_operations.py index 2d2a9766c6d6d..007ab4449a0e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_peerings_operations.py index 98ad7e265278b..d320b48af1dc1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuits_operations.py index 3bf94d68caf1e..cf0949dedc38a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_service_providers_operations.py index c4de7baa3ff71..2d1908502b539 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_inbound_nat_rules_operations.py index 69e6fb80b37c1..10ea5627d20c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py index cdad6a60aa10c..ff88d7a00e369 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index cbb6762a3ce81..59370b4e38f89 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 065210b76e5c0..5a5f7b4d79e10 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_network_interfaces_operations.py index 888fc12d87e31..f133826ba72f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_probes_operations.py index 670b45c906b85..7a19d360fa1e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancers_operations.py index 223ac7f3ef27a..37712084ff64a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_local_network_gateways_operations.py index 146ea0cd4371d..111d7b8638783 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_ip_configurations_operations.py index a22ea2c238f26..ad8373a9e4057 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_load_balancers_operations.py index f873f4e90ac00..ba23b4604078b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interfaces_operations.py index 769369c3f9d05..b72589a180158 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_management_client_operations.py index c9ec7e9617212..938d16f9877b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_11_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_security_groups_operations.py index 88d02e8f094e9..cccd1bf7ecf46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_watchers_operations.py index 3ddbb8abd87f6..27b5ec6a96767 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,9 +281,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -351,7 +357,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +416,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +424,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,9 +483,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -493,7 +499,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2017_11_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +549,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,9 +606,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -622,7 +628,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +653,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,10 +677,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,9 +734,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -744,7 +756,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -787,10 +805,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,9 +862,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -866,7 +884,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -891,7 +909,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -909,10 +933,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -966,9 +990,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -988,7 +1012,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1013,7 +1037,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1031,10 +1061,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1088,9 +1118,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1110,7 +1140,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1135,7 +1165,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1153,10 +1189,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1210,9 +1246,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1232,7 +1268,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1257,7 +1293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1275,10 +1317,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1332,9 +1374,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1354,7 +1396,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1379,7 +1421,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1397,10 +1445,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1454,9 +1502,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1477,7 +1525,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1502,7 +1550,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1520,10 +1574,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,9 +1631,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1600,7 +1654,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1625,7 +1679,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1643,10 +1703,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1700,9 +1760,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1722,7 +1782,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1747,7 +1807,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_operations.py index e0d47adca34f4..b2d16733888d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_packet_captures_operations.py index 3bbe2eee28071..a4d60dbd2ace9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_public_ip_addresses_operations.py index bb2a982fc7bb6..44bb03423ae19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filter_rules_operations.py index c9332fde9ece9..0cb4dfe3f138a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filters_operations.py index 812b5075471af..c8439d1343b41 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_tables_operations.py index 13589e6606974..7ce7d97050c70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_routes_operations.py index db1296f0fc7f7..0ea8a20c40b40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_security_rules_operations.py index 694ad6960e8df..deeaa3c260ecc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_subnets_operations.py index 72cc99c7d508a..417196dee3f95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_usages_operations.py index d4ef69b92c14d..0cc2343ede8e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateway_connections_operations.py index 3edd602a20742..4d59da24a2793 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + ) -> "_models.VirtualNetworkGatewayConnectionListEntity": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateways_operations.py index a7650216c44b4..a9e2f75c47fdd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,7 +1525,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_peerings_operations.py index 283dc37faa6e4..89dd753b47595 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_networks_operations.py index fff70f0beab7d..92e4c8d4610e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_11_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_gateways_operations.py index a8fa43436b4c8..041efb38cd43b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_security_groups_operations.py index 7c3f6f3abab0a..70144de386c3f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_available_endpoint_services_operations.py index d1abd7094fc30..e57329fffbd42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_bgp_service_communities_operations.py index 7df3884c9a655..2c3c45d090eed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_connection_monitors_operations.py index fda005acf9534..04ba7d63007ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -442,7 +456,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -550,7 +571,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -571,8 +599,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -625,7 +653,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -645,7 +673,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +698,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -690,7 +725,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -702,7 +737,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_default_security_rules_operations.py index c3f989338a65c..ed90360f273be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_authorizations_operations.py index 689f9d80b1f10..18c0e4730153c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_peerings_operations.py index 3f15ad0bb9c2b..bb2d2e82659d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuits_operations.py index e5f33b9270ace..283d7183b1945 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_service_providers_operations.py index 0b6e4e7397fff..77e784012053b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_inbound_nat_rules_operations.py index 5202b4581dfcd..60a5e85fa1bd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py index f72f4b9dc809d..3c4afb27e8bcd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py index b22faf092b4d0..3bbdc5a4d1afb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_load_balancing_rules_operations.py index 965005934cbec..7305006deedfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_network_interfaces_operations.py index cfcf2a9b03f8d..8bc9432439ac2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_probes_operations.py index 7a7f9d28a4f47..da1c43afa00d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancers_operations.py index 42130940d94b9..4b6b8ddb0487e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_local_network_gateways_operations.py index f62874fa87df9..fd1eccff0854d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_ip_configurations_operations.py index 0e962e3271d6e..7fe9f7d01ad61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_load_balancers_operations.py index c61a11fd7ad6f..422cdc50c11d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interfaces_operations.py index 5cbda34be2033..3165f5590ff9f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_management_client_operations.py index 4762b6f2333d6..3b7d80dc4f478 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2017_11_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_security_groups_operations.py index e0a821bf7a18a..ed16e5ce55964 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_watchers_operations.py index 3614127a10ab3..134e802ebdce4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,10 +289,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +357,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +427,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -429,7 +435,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,10 +494,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -505,7 +511,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2017_11_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -555,11 +561,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,10 +619,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -636,7 +642,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -661,7 +667,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -679,11 +691,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -737,10 +749,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -785,7 +797,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -803,11 +821,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,10 +879,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -884,7 +902,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -909,7 +927,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -927,11 +951,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -985,10 +1009,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1008,7 +1032,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1033,7 +1057,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1051,11 +1081,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,10 +1139,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1132,7 +1162,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1157,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1175,11 +1211,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1233,10 +1269,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1256,7 +1292,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1281,7 +1317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1299,11 +1341,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1357,10 +1399,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1380,7 +1422,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1405,7 +1447,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1423,11 +1471,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1481,10 +1529,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1505,7 +1553,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1530,7 +1578,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1548,11 +1602,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,10 +1660,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1630,7 +1684,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1655,7 +1709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1673,11 +1733,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1731,10 +1791,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1754,7 +1814,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1779,7 +1839,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_operations.py index 6e2aa9d751292..63568675ecbe6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_packet_captures_operations.py index d2673b58d32ad..2d8139f44904e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_public_ip_addresses_operations.py index 26848400e793c..5f934d7baf79b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filter_rules_operations.py index b115e16114391..8517fdea2cc18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filters_operations.py index 64f1cc4c9845e..fed20ec2e702b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_tables_operations.py index de4a48bc38121..0ccf1567f40b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_routes_operations.py index c018b5f78d492..8d51477d08d01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_security_rules_operations.py index 6574cc5302654..b4c07ef387e16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_subnets_operations.py index 882d7c0797d65..1180ec68654dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_usages_operations.py index 5fd5ae9088817..7d64deeee28ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateway_connections_operations.py index e0ea627daf447..76a1566fe4a39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnectionListEntity" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> "_models.VirtualNetworkGatewayConnectionListEntity" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateways_operations.py index 88020331b51c2..ee6faa6b29842 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,7 +1553,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_peerings_operations.py index 1b888db9b441a..fbea0590e295f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_networks_operations.py index ab305c61a6ac1..8fa719e235a67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2017_11_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_metadata.json index 1f126a127478d..8c40850a9296e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -97,7 +98,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_01_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_network_management_client.py index 94567e074e8a8..e4af9b0107b95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/_network_management_client.py @@ -159,7 +159,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/_network_management_client.py index 1fc7883f59b7c..404933231bc2c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/_network_management_client.py @@ -156,7 +156,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_gateways_operations.py index d3bfa95a97c21..a44cb64e6c20f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_security_groups_operations.py index 669499475cd84..aa410a520f633 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_available_endpoint_services_operations.py index 0ad3faf9352ae..867325829e380 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_bgp_service_communities_operations.py index 70f8c508bacbf..190373ed0ff4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_connection_monitors_operations.py index 266f8a24a006c..aecb657f1152b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -431,7 +445,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -537,7 +558,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -557,8 +585,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +638,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -630,7 +658,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +683,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -674,7 +709,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -686,7 +721,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_default_security_rules_operations.py index a908265f9ebb6..0b6f6835e04e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_authorizations_operations.py index 9c0464fd2ee39..4e09298108d09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_peerings_operations.py index 7b60092980fa3..3e68a7d5f562c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuits_operations.py index b9096b015fae7..ca2c547a6141f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_service_providers_operations.py index 812f89a551c45..9a657484047e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_inbound_nat_rules_operations.py index ec5d44479faaa..85dd341beff16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 5bfec9310d1dc..c63378f5808a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 4b2c888ac8ce5..14c8ef191d30c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 62f0489a5cb68..42992dec51a2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_network_interfaces_operations.py index 60f5ba4bd4c0c..d7e7770bf3904 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_probes_operations.py index 16b2fe4e4167e..1636aa05508ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancers_operations.py index cd9cbf4912559..5a0c1d7ef2ca0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_local_network_gateways_operations.py index 76f0b09b26238..c843ae93042c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_ip_configurations_operations.py index 0f5d996a4b4e0..8096dd14d1817 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_load_balancers_operations.py index 26fc0ad29e1b2..d2e0a24caa494 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interfaces_operations.py index afddbac986cd8..605fb0879c472 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_management_client_operations.py index 92c5bd7a124bd..de12b0705d6e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_01_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_security_groups_operations.py index 4c5f587ab4b15..044ee34ebcaa5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_watchers_operations.py index c6847e377c41b..4cdbe2100f2f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,9 +281,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -351,7 +357,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +416,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +424,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,9 +483,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -493,7 +499,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_01_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +549,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,9 +606,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -622,7 +628,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +653,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,10 +677,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,9 +734,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -744,7 +756,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -787,10 +805,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,9 +862,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -866,7 +884,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -891,7 +909,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -909,10 +933,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -966,9 +990,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -988,7 +1012,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1013,7 +1037,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1031,10 +1061,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1088,9 +1118,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1110,7 +1140,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1135,7 +1165,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1153,10 +1189,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1210,9 +1246,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1232,7 +1268,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1257,7 +1293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1275,10 +1317,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1332,9 +1374,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1355,7 +1397,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1380,7 +1422,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1398,10 +1446,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1455,9 +1503,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1478,7 +1526,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1503,7 +1551,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1521,10 +1575,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1578,9 +1632,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,7 +1655,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1626,7 +1680,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1644,10 +1704,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,9 +1761,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1723,7 +1783,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1748,7 +1808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_operations.py index 6f0156b27f976..6046c0e6c6cca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_packet_captures_operations.py index 3cfcb60381165..e8d1bd04b4db1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_public_ip_addresses_operations.py index 2984a50888b5e..12cbec7937494 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filter_rules_operations.py index b6e55b59c72e1..abb000fc023ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filters_operations.py index 49240a80da7bf..a7576b1ea4abc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_tables_operations.py index 4bb13eb0ceb03..1a249ffc2ae0e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_routes_operations.py index 72390c31c87ac..f35eaaf58a1ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_security_rules_operations.py index 193144747f6d4..15d5c81321359 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_subnets_operations.py index 1cdaeb3022658..58ee624dbc75e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_usages_operations.py index 4da61245843ed..266dcf4ab66f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateway_connections_operations.py index 49a11945f2dac..db00362ead400 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + ) -> "_models.VirtualNetworkGatewayConnectionListEntity": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateways_operations.py index 6074ef879a4a9..39a40afbd0769 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,7 +1525,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_peerings_operations.py index 0e9af17ff2597..a92c6dd9ac2b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_networks_operations.py index f03fc648e1b9d..51ec06097cac1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_01_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_gateways_operations.py index 2dd8b9ade07b7..f1269ed82c866 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_security_groups_operations.py index 05ebff2069554..bf3aeb94a27b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_available_endpoint_services_operations.py index 5a401fafbb1ea..4a6ef0e72b2cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_bgp_service_communities_operations.py index dd000892dbefb..b0c11c2cd4419 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_connection_monitors_operations.py index 5a2b6625d713d..1d43143f325d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -442,7 +456,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -550,7 +571,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -571,8 +599,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -625,7 +653,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -645,7 +673,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +698,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -690,7 +725,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -702,7 +737,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_default_security_rules_operations.py index 5d7db9676374e..177a2a00a7cb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_authorizations_operations.py index a926d01eddddd..4c26154ce812a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_peerings_operations.py index e45fdf6ac80db..7da385140ad56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuits_operations.py index 96f68f664169b..57a29bec8f1ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_service_providers_operations.py index 6d7f49f8cda19..b9d1b046d7be3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_inbound_nat_rules_operations.py index 0e323ff400f03..26aba23d85a3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_backend_address_pools_operations.py index 081d653057cba..516b0d2efdd7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 632a76659cfb8..06c05aff40f42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_load_balancing_rules_operations.py index 37ca2310cbf2f..6fc442ff3c2a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_network_interfaces_operations.py index be1d386265451..f9e95fce37a77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_probes_operations.py index ac2a3081c5a40..d1fe250e95456 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancers_operations.py index 77f4cb3e989bc..141f0bc86d648 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_local_network_gateways_operations.py index c4a4def3524d4..41cdd676b1ed3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_ip_configurations_operations.py index ee19eba069c5e..ce3f436b7c00c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_load_balancers_operations.py index 471b2c1b746ea..df9a643a7255d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interfaces_operations.py index dc48b6ee78fa5..b17fe8a5d46d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_management_client_operations.py index e395e6c6b676e..48a5e83124cc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_01_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_security_groups_operations.py index 34c1fa0d21384..e7f39f103dd26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_watchers_operations.py index d48c3f37b86b2..38eb843acbc88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,10 +289,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +357,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +427,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -429,7 +435,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,10 +494,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -505,7 +511,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_01_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -555,11 +561,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,10 +619,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -636,7 +642,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -661,7 +667,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -679,11 +691,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -737,10 +749,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -785,7 +797,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -803,11 +821,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,10 +879,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -884,7 +902,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -909,7 +927,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -927,11 +951,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -985,10 +1009,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1008,7 +1032,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1033,7 +1057,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1051,11 +1081,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,10 +1139,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1132,7 +1162,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1157,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1175,11 +1211,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1233,10 +1269,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1256,7 +1292,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1281,7 +1317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1299,11 +1341,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1357,10 +1399,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1381,7 +1423,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1406,7 +1448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1424,11 +1472,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1482,10 +1530,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1506,7 +1554,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1531,7 +1579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1549,11 +1603,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1607,10 +1661,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1631,7 +1685,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1656,7 +1710,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1674,11 +1734,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,10 +1792,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1755,7 +1815,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_operations.py index d619b6170da96..2fdf3d2998fe0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_packet_captures_operations.py index ad79a0cda9976..2875309b370a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_public_ip_addresses_operations.py index 159798afc3845..1e00f6c26e54b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filter_rules_operations.py index 9891002907b13..3117ee70b9770 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filters_operations.py index c5aa858f032a9..a0eaa6ea0f012 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_tables_operations.py index 4aa2120e555cb..8395cd8630ccc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_routes_operations.py index 10268608d5455..66ffacbb815a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_security_rules_operations.py index 700c9d2b9b50d..775a4ceef587d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_subnets_operations.py index ec80a91951f57..b81da5e13abdc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_usages_operations.py index 856f213a2de20..54a8a57b1c7d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateway_connections_operations.py index 1288096b6da8c..441b1663e973c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnectionListEntity" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> "_models.VirtualNetworkGatewayConnectionListEntity" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateways_operations.py index b21d0d6235b97..ef67f4ce6d1d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,7 +1553,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_peerings_operations.py index 0000410148c3f..72a134e8800a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_networks_operations.py index 8d6342bf0a0e9..670aaa8b33880 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_01_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_metadata.json index f6b3cbd5429b6..39d136c1ec9ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -101,7 +102,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_02_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_network_management_client.py index d6b4448ac15f1..da9af7b643147 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/_network_management_client.py @@ -171,7 +171,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/_network_management_client.py index 19b25947d1319..e2d144880ff12 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/_network_management_client.py @@ -168,7 +168,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_gateways_operations.py index 03008134f15b4..c1edb19c3f8eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_security_groups_operations.py index e7f35be842d59..d47fb4b0a5b3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_available_endpoint_services_operations.py index 37211267a1566..2c6c4275df5b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_bgp_service_communities_operations.py index d69d6f19ba2b7..820958e2573d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_connection_monitors_operations.py index 1a22e822bb448..d397e69da5863 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -431,7 +445,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -537,7 +558,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -557,8 +585,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +638,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -630,7 +658,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +683,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -674,7 +709,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -686,7 +721,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_ddos_protection_plans_operations.py index a76176b99116a..d5172fab392fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_default_security_rules_operations.py index b438e22a8120b..57894b46ebeb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_authorizations_operations.py index 20d51f3fbc7a4..a282241993d47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_connections_operations.py index b4f972923a89b..1d95f1d50ef73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -141,7 +141,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -162,7 +170,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +186,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,10 +235,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +296,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -315,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +350,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py index 206033317af5f..971e9f8d4c461 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuits_operations.py index 336cbde3c26b7..f218425e4ae3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py index cfdc103396b2e..683015a06daba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connections_operations.py index 9697645664af3..6094eae0623f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_service_providers_operations.py index dddabfad99f04..4ab25e7146c5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_inbound_nat_rules_operations.py index 037899fa820d2..7c3b9eabfa58c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py index f07216018d9d7..ff3785dddb0e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 3348e9bb14f24..f842961cc7e5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 6a7d80cf21023..ee49a72e72d6a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_network_interfaces_operations.py index 1f37b1034a5ba..3aedf5d108477 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_probes_operations.py index 310fd9b9b7b30..9a8b5bbeb1b3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancers_operations.py index 2de3e95c03fff..8e1f60214918e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_local_network_gateways_operations.py index 77b9f58a6771f..d51b5b9d14cda 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_ip_configurations_operations.py index 4560c10e18c8c..0f08c3220e3d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_load_balancers_operations.py index 6b293d1f6f84f..b0b5c58e696da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interfaces_operations.py index 0a1c0d3b8a66d..23db6c3aa8d50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_management_client_operations.py index a9150f8a2d07e..ca7c96d9033f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_02_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_security_groups_operations.py index 8c61b22db0b42..33d582d13cf30 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_watchers_operations.py index f843ec9c332ac..e7a7fc2b156ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,9 +281,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -351,7 +357,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +416,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +424,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,9 +483,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -493,7 +499,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_02_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +549,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,9 +606,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -622,7 +628,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +653,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,10 +677,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,9 +734,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -744,7 +756,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -787,10 +805,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,9 +862,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -866,7 +884,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -891,7 +909,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -909,10 +933,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -966,9 +990,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -988,7 +1012,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1013,7 +1037,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1031,10 +1061,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1088,9 +1118,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1110,7 +1140,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1135,7 +1165,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1153,10 +1189,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1210,9 +1246,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1232,7 +1268,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1257,7 +1293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1275,10 +1317,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1332,9 +1374,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1354,7 +1396,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1379,7 +1421,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1397,10 +1445,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1454,9 +1502,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1477,7 +1525,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1502,7 +1550,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1520,10 +1574,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,9 +1631,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1600,7 +1654,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1625,7 +1679,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1643,10 +1703,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1700,9 +1760,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1722,7 +1782,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1747,7 +1807,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_operations.py index 65f29ccedf215..2432d36700a32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_packet_captures_operations.py index 28621b8a9a4d8..cf948f3a9d1f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_public_ip_addresses_operations.py index 9540b81dd412d..7a29c7c77868e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filter_rules_operations.py index 8d5e410452474..99cf3ac7fffd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filters_operations.py index 2741af73285fb..52ab16ddfe095 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_tables_operations.py index 5e68f6adf02cf..1c6396f148594 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_routes_operations.py index f5c382ce5c06b..d818fb9e7607b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_security_rules_operations.py index 293c6507bd129..d1a67faff65fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_subnets_operations.py index 554215dc948d6..d44ec3ca5229b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_usages_operations.py index 303339745a55a..17107a5e9f607 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateway_connections_operations.py index 95fdcbdc5b6c8..595d062cc09ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + ) -> "_models.VirtualNetworkGatewayConnectionListEntity": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateways_operations.py index 1cca55a09511a..85f1b5f788622 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,10 +1525,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1520,9 +1580,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1544,7 +1604,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1569,7 +1629,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1588,8 +1654,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1635,7 +1701,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1655,7 +1721,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1679,7 +1745,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1697,7 +1769,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_peerings_operations.py index 42c04e130e582..4c3ae0712560d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_networks_operations.py index 2a3ebc13714d1..48587e33a73bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_02_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_gateways_operations.py index 02c8ba51703e4..7e9f78b17f013 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_security_groups_operations.py index dd4ae8d5de2a4..73aeffcf654a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_available_endpoint_services_operations.py index b8f347d5e0674..ad5ca016a0875 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_bgp_service_communities_operations.py index 0dc28147d2f70..634d7c6b579d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_connection_monitors_operations.py index 9544dab6f55cd..842fa5634729b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -442,7 +456,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -550,7 +571,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -571,8 +599,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -625,7 +653,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -645,7 +673,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +698,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -690,7 +725,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -702,7 +737,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_ddos_protection_plans_operations.py index 8c25c70fa13d0..23ef8c41ff2a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_default_security_rules_operations.py index 64666b1b64c57..6ed1ccf5ba425 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_authorizations_operations.py index 2726b68eb8ad9..275695107ecc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_connections_operations.py index 792dbe74fb883..78490db9dd7fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -147,7 +147,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -169,7 +177,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -185,7 +193,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,11 +242,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +304,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -324,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +359,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_peerings_operations.py index 9885427664c30..960854ad247f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuits_operations.py index a4b66a8f2a60d..0c678a1cd4283 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connection_peerings_operations.py index bc8d1decb665d..fc7d9806d7a3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connections_operations.py index c81cfa451a39e..c43ed808450bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_service_providers_operations.py index 07b46cd076856..7e13babc69f9b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_inbound_nat_rules_operations.py index 004e44e3250ec..44abd8f9ae487 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_backend_address_pools_operations.py index 62728813b860b..ac015ff5f3016 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py index aad3eb70dab6a..93e777a0a0d1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_load_balancing_rules_operations.py index 8976d92702e38..a4149452dbae6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_network_interfaces_operations.py index 2e1b4fa98ef2b..b3188df19c9d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_probes_operations.py index 7a1da2eb395ec..f972dbdfc6137 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancers_operations.py index 3b1a5fd0e3b4a..9a9e59971f7bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_local_network_gateways_operations.py index 209223877f94e..1e490c97a7b1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_ip_configurations_operations.py index a66f7c8bf2988..dbc2d9ce784de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_load_balancers_operations.py index b56972f9f70ba..126a97a5c8d48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interfaces_operations.py index a191de2b05a57..4f665c6e3381d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_management_client_operations.py index b217e2da37e5f..ad5d848e99d32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_02_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_security_groups_operations.py index b5cb221d25253..384ef2460b2e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_watchers_operations.py index 7dbe0211fe157..4595a51e681ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,10 +289,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +357,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +427,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -429,7 +435,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,10 +494,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -505,7 +511,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_02_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -555,11 +561,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,10 +619,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -636,7 +642,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -661,7 +667,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -679,11 +691,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -737,10 +749,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -785,7 +797,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -803,11 +821,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,10 +879,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -884,7 +902,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -909,7 +927,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -927,11 +951,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -985,10 +1009,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1008,7 +1032,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1033,7 +1057,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1051,11 +1081,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,10 +1139,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1132,7 +1162,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1157,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1175,11 +1211,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1233,10 +1269,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1256,7 +1292,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1281,7 +1317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1299,11 +1341,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1357,10 +1399,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1380,7 +1422,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1405,7 +1447,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1423,11 +1471,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1481,10 +1529,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1505,7 +1553,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1530,7 +1578,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1548,11 +1602,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,10 +1660,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1630,7 +1684,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1655,7 +1709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1673,11 +1733,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1731,10 +1791,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1754,7 +1814,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1779,7 +1839,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_operations.py index 9ffe3c00b9eb5..21c853ede681c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_packet_captures_operations.py index 9ec0bc87d0fbf..f1e9a9afea972 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_public_ip_addresses_operations.py index e5714a9adc5dd..b644b5b45a494 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filter_rules_operations.py index 9572f4dfb93f9..8c2de7cd996ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filters_operations.py index 39fb2924c1f4b..0231f0b3c0bcf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_tables_operations.py index 1efb707643544..afff7e4840522 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_routes_operations.py index a72e425244eae..41b03e9dcab6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_security_rules_operations.py index a6d78ddd85248..7701777091db7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_subnets_operations.py index abe2525ef917e..e015b3b6aa869 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_usages_operations.py index 78c6aec2edba5..2a08d6a027925 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateway_connections_operations.py index 9d1315a5c4f0f..c04d683a41257 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnectionListEntity" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> "_models.VirtualNetworkGatewayConnectionListEntity" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListEntity"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListEntity"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateways_operations.py index 98b9d4e808c97..688e188d1605e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,11 +1553,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1549,10 +1609,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1574,7 +1634,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1599,7 +1659,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1619,8 +1685,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1667,7 +1733,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1687,7 +1753,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1711,7 +1777,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1729,7 +1801,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_peerings_operations.py index 4122b41af445c..c8644773d8f1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_networks_operations.py index 7c26cd8546625..342d2eb3cbcdb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_02_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_metadata.json index 05c04a84e0a0a..f1673f111dcdc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -109,7 +110,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_04_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_network_management_client.py index 5fb1702263767..ef634fa73cad5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/_network_management_client.py @@ -195,7 +195,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.azure_firewalls = AzureFirewallsOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/_network_management_client.py index 38fbf28dfb4ae..9c75b1cc30a59 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/_network_management_client.py @@ -192,7 +192,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.azure_firewalls = AzureFirewallsOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_gateways_operations.py index 5f8e1bbc4c9a4..401693f287e68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_security_groups_operations.py index 81ed85251cbb9..ed8a351b5fcc5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_available_endpoint_services_operations.py index b441ebcca2ec5..914c88f47d446 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_azure_firewalls_operations.py index ee601f0169cbf..51408bfce3706 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_bgp_service_communities_operations.py index 39df4eab38d6f..479356251df0b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_connection_monitors_operations.py index c6860c10776a4..9253bb4a03c0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -431,7 +445,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -537,7 +558,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -557,8 +585,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +638,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -630,7 +658,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +683,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -674,7 +709,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -686,7 +721,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_ddos_protection_plans_operations.py index a1fba8c1af75b..58b007a67b2c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_default_security_rules_operations.py index d9d3154aba9c1..11821fed814a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_authorizations_operations.py index db531170fa3df..75f7ac0e8e225 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_connections_operations.py index d35f696a6f388..65bb28c9b8be6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -141,7 +141,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -162,7 +170,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +186,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,10 +235,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +296,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -315,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +350,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_peerings_operations.py index d1f62d0c54077..fbfe7f8b80e58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuits_operations.py index 755dae47a0ca6..ac0efb14a9f8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 8fbdc1d2ff97d..0bceaa0a3d5db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connections_operations.py index 25787541f2422..f378b87f433c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_service_providers_operations.py index 8ee9eacb45edd..510e24522e0af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_hub_virtual_network_connections_operations.py index 48530845ebbd2..a5284a407ccad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_inbound_nat_rules_operations.py index 7e1cef133d160..44036db98bed4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 94410a18166ee..c8ce171c4a6e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index db05fd23b6f22..66596ccc812b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 1d5d8c31cd257..1c611a1ab2d84 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_network_interfaces_operations.py index 5fd6d3f924983..a39cffc9ff84f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_probes_operations.py index a99ad894e0dd5..8e5c9344559de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancers_operations.py index ccc56a26e91e3..3c98e574ee54c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_local_network_gateways_operations.py index 3c693318302c1..e357b260b684d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_ip_configurations_operations.py index 146c085471f97..14aa9d27f5c9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_load_balancers_operations.py index 826d0048cdec4..572a5363bad05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interfaces_operations.py index 6ff980fe78b58..c7a53f5e9a6a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_management_client_operations.py index 08a6d8884ba97..9e799704589a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_04_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_security_groups_operations.py index 53b4ee8ee3471..f00059977303f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_watchers_operations.py index 37608a8a42b31..474280d70e6d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,9 +281,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -351,7 +357,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +416,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +424,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,9 +483,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -493,7 +499,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_04_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +549,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,9 +606,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -622,7 +628,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -647,7 +653,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -665,10 +677,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,9 +734,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -744,7 +756,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -787,10 +805,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,9 +862,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -866,7 +884,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -891,7 +909,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -909,10 +933,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -966,9 +990,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -988,7 +1012,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1013,7 +1037,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1031,10 +1061,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1088,9 +1118,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1110,7 +1140,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1135,7 +1165,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1153,10 +1189,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1210,9 +1246,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1232,7 +1268,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1257,7 +1293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1275,10 +1317,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1332,9 +1374,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1355,7 +1397,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1380,7 +1422,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1398,10 +1446,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1455,9 +1503,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1478,7 +1526,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1503,7 +1551,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1521,10 +1575,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1578,9 +1632,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,7 +1655,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1626,7 +1680,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1644,10 +1704,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,9 +1761,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1723,7 +1783,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1748,7 +1808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_operations.py index 15efc257aa01e..68cb1bec08940 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_packet_captures_operations.py index 554e01cdfa4e4..e0929175c4581 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,9 +103,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -173,7 +180,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -187,7 +194,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +328,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -427,7 +441,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,8 +468,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -520,7 +541,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -545,7 +566,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -564,7 +592,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -576,7 +604,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_public_ip_addresses_operations.py index f025c058db5d2..417b0703f7f92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py index dce5761253308..4a1a888d255ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filters_operations.py index 30342ce873f5e..c198fed3be8b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_tables_operations.py index 721fafe1b234b..2e992cc32eaf4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_routes_operations.py index f3f0fab2ff332..3e81d44017647 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_security_rules_operations.py index ae5128719c988..002ea760e8b18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_subnets_operations.py index 0143027a1e84d..9fd3c54c61bdc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_usages_operations.py index 09954e43120e4..f574bbfec387c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_hubs_operations.py index 6d95bcffd3932..a55588069a5fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateway_connections_operations.py index e316c921b2566..90c1f048c38c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateways_operations.py index 00a49c2d0ea92..999bb1c4b8de9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,10 +1525,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1520,9 +1580,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1544,7 +1604,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1569,7 +1629,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1588,8 +1654,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1635,7 +1701,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1655,7 +1721,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1679,7 +1745,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1697,7 +1769,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_peerings_operations.py index fc9f54591749c..ff34a7b89eca3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_networks_operations.py index 5f211f16ced0b..0d70849aeda9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_04_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_wans_operations.py index af29b82dc8123..407aa3a0b2a97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWANsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_connections_operations.py index fc72ed4096a04..3089af89dae74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_gateways_operations.py index 446118ba1f59b..95a4f59e4a2d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_configuration_operations.py index 08de4eb1b1acb..a15295f43dd91 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_operations.py index bd43573ba84c8..b4d6cff4c22ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_gateways_operations.py index 25ae4fb20098a..ecda190f6a630 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_security_groups_operations.py index 7a00f5b530cf2..155765fdc1a0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_available_endpoint_services_operations.py index af5c4a164f979..11cffab6c05de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py index a663d4c688494..1f467572d2650 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_bgp_service_communities_operations.py index d97ff3d5fe3bd..171ffc296c846 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_connection_monitors_operations.py index 6708625ebd444..d6f369f02dacc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -442,7 +456,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -550,7 +571,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -571,8 +599,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -625,7 +653,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -645,7 +673,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -670,7 +698,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -690,7 +725,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -702,7 +737,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_ddos_protection_plans_operations.py index f5c862fe6fe69..4689f4f341a44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_default_security_rules_operations.py index b93537b4565d0..b4f3ec24eb2be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_authorizations_operations.py index a782169ff7c36..d8c22e52eab8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_connections_operations.py index 9b48c4a1b3205..c1251e74eacf2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -147,7 +147,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -169,7 +177,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -185,7 +193,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,11 +242,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +304,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -324,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +359,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_peerings_operations.py index ba49ee3058202..043c0f27b790d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuits_operations.py index abf99bd4e3ff1..19943a4450345 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connection_peerings_operations.py index 68c3329b50a49..dc26e1d5d43dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connections_operations.py index 13647261ab659..5efb7a3263e7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_service_providers_operations.py index 42b7fc2b84fd3..2cdcd691c8ef2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_hub_virtual_network_connections_operations.py index c0d68abec96be..c41e1940ba29d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_inbound_nat_rules_operations.py index b3055fe17a195..cd0f0c35dbafa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_backend_address_pools_operations.py index d0bd02effeb8f..c3e13bda7db16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 16dc72bbbe946..d0626a20a4c4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_load_balancing_rules_operations.py index 8f117d0baca6c..3512efca976ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_network_interfaces_operations.py index 3ad2ac6e7173c..7e2288d2b18dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_probes_operations.py index 727e38738f774..5f4d0717b9df1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancers_operations.py index fb8dd92cf6e37..7f40c5ca4b4c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_local_network_gateways_operations.py index 53e94684edfcc..5943dcddf2a65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_ip_configurations_operations.py index 2af9bdf08dc94..ebdf6f7b5b6af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_load_balancers_operations.py index b3465321eec14..915ea8ecc6f86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interfaces_operations.py index cfdf7da202742..35ef898bad7b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_management_client_operations.py index 795b2c9772e85..d29249842a9a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_04_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_security_groups_operations.py index 932a038efcf81..0be57af1158c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_watchers_operations.py index e47bbbd2a5d74..7c2261b0cfd8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -124,7 +124,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,10 +289,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +357,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +427,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -429,7 +435,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,10 +494,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -505,7 +511,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_04_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -555,11 +561,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,10 +619,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -636,7 +642,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -661,7 +667,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -679,11 +691,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -737,10 +749,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -760,7 +772,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -785,7 +797,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -803,11 +821,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,10 +879,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -884,7 +902,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -909,7 +927,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -927,11 +951,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -985,10 +1009,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1008,7 +1032,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1033,7 +1057,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1051,11 +1081,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,10 +1139,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1132,7 +1162,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1157,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1175,11 +1211,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1233,10 +1269,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1256,7 +1292,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1281,7 +1317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1299,11 +1341,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1357,10 +1399,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1381,7 +1423,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1406,7 +1448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1424,11 +1472,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1482,10 +1530,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1506,7 +1554,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1531,7 +1579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1549,11 +1603,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1607,10 +1661,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1631,7 +1685,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1656,7 +1710,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1674,11 +1734,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,10 +1792,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1755,7 +1815,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_operations.py index df834b8d3eef8..474ae627f398d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_packet_captures_operations.py index 8319fd94d6852..c8ce96954f274 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,10 +108,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -180,7 +187,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -194,7 +201,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -438,7 +452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,8 +480,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +534,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -533,7 +554,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -558,7 +579,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -578,7 +606,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -590,7 +618,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_public_ip_addresses_operations.py index b66183e1ba6ab..c591cff0cc873 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filter_rules_operations.py index 02380498918c3..1cdca929b8fed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filters_operations.py index ab37e6f0b4960..7105f835685b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_tables_operations.py index 0d158a9970721..228bdd265be59 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_routes_operations.py index 826f1e0ac2c16..264417edbd978 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_security_rules_operations.py index ea08ba5224ccf..763af01f406c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_subnets_operations.py index 0b699baa95de9..3096fdec00d24 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_usages_operations.py index 0bc23cf87fa43..a314c9bcd897e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py index 9a715b10f490a..11ad2d82868cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateway_connections_operations.py index 2544c6b752870..ed8045ef92a5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateways_operations.py index e6d643888c525..809ac26bfdbe5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,11 +1553,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1549,10 +1609,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1574,7 +1634,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1599,7 +1659,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1619,8 +1685,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1667,7 +1733,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1687,7 +1753,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1711,7 +1777,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1729,7 +1801,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_peerings_operations.py index 78efc30955b92..37149ee5c0f17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_networks_operations.py index de53f1686b774..1c73c7292541b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_04_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_wans_operations.py index 48130b5ab84c5..592c5a74e2486 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWANsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_connections_operations.py index 4ca688e790297..949ce12285843 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_gateways_operations.py index 62ae607dde5d7..400be11c7d0e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_configuration_operations.py index 7f46640eb70cf..a793eff00e006 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_operations.py index ccd9c8669a9fa..66dcb07d2ce3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_metadata.json index c5983cb67b0ee..2854262642991 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -109,7 +110,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_06_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_network_management_client.py index 886b9ca3b24ca..f9d9b2c057cbf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/_network_management_client.py @@ -195,7 +195,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.azure_firewalls = AzureFirewallsOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/_network_management_client.py index 685284f84bd91..1f18033887a11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/_network_management_client.py @@ -192,7 +192,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.azure_firewalls = AzureFirewallsOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_gateways_operations.py index ac4067ea29ef1..7b4166e9a1f4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_security_groups_operations.py index 2c07ec548d402..645c9532a1373 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_available_endpoint_services_operations.py index cb64c148e0591..8cd083bec4c32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_azure_firewalls_operations.py index 2f45fc19be2e8..e3971f6c9fc95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_bgp_service_communities_operations.py index 24517a3bbad8d..c982eb30da9a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_connection_monitors_operations.py index ca707d3cee213..df9e721cab9c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_ddos_protection_plans_operations.py index af3dae98a9d8c..aa0f50f1a3074 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_default_security_rules_operations.py index 03c70103bd7d4..3a626d6c66943 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_authorizations_operations.py index 449838960dd0b..bfffbfd0c13a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_connections_operations.py index 327b8f6aac5ed..e53c6b8957669 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -141,7 +141,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -162,7 +170,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +186,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,10 +235,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +296,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -315,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +350,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_peerings_operations.py index d24b2fbcc85f4..94b91319500d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuits_operations.py index 50c232c830f77..f5fadc4659dbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py index acdbaf816b785..457722c41c56a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connections_operations.py index ebe7bbaca0c22..9b6bf91b193df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_service_providers_operations.py index 3ce44b992bac5..a4bd266f3bd80 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_hub_virtual_network_connections_operations.py index 186f1d1f52c6c..c77e9e8bc8130 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_inbound_nat_rules_operations.py index edcffe74e95de..9136ab9b4e80e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py index fdc740205a26b..8a87ebd7c7ea5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index d3f2163b2d52e..670d36d5e19ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 57ea4a25d335d..4c316b147df96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_network_interfaces_operations.py index aa529756ba884..a7efa30829f70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_probes_operations.py index 53c06312d3095..0f54d015aa3dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancers_operations.py index c9ffbfdccd4a5..3ba04aa140f86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_local_network_gateways_operations.py index a1afcb84ede0c..30443df5354af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_ip_configurations_operations.py index f5b4b2dbb8246..a414801e4304b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_load_balancers_operations.py index 1f2067b3218c2..325cf0398db2d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py index af04abfb7aca6..170a49576841a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_management_client_operations.py index 115ede023032e..b5dc390cf581f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_security_groups_operations.py index 39c809c652c88..92b6721512e83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_watchers_operations.py index 052c2d9bd2571..1037dcf254f41 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_operations.py index d188b535239ec..811ecd48a1318 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_packet_captures_operations.py index c630e32223651..2f9a76c53a1e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py index f85e0069485f1..73b607b5ad4c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filter_rules_operations.py index d774aad239014..a7975b6f3a4ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filters_operations.py index a1168bd363205..0758289a2068e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_tables_operations.py index accd7a2790514..7fb0cd6e930e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_routes_operations.py index 789c312daa5da..1a8bb45860ae1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_security_rules_operations.py index 241b01d9e1893..63b551094792d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_subnets_operations.py index 5f992dd78c833..5f1c29fc60d2c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_usages_operations.py index 3732bdb14b67a..91570fb0ae236 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_hubs_operations.py index 7b969c508d633..7bc56161754c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateway_connections_operations.py index f654f5e931d1b..8400ff7c8df0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateways_operations.py index 7657777e8c655..e1bb986a3833c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_peerings_operations.py index 2f0457cd8c2c2..11911f11b1412 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_networks_operations.py index 8d3395137bdcb..b411fdb17fc77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_wans_operations.py index 0babbde64cf04..3bf6323b52aeb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWANsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py index 4f68aff515585..202d9e4076966 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_gateways_operations.py index e3d7595ae7e7b..827588628e8c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_configuration_operations.py index 8278909132de0..3f346c103f00c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_operations.py index c8e2c53ed2296..d95e79cfc9868 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_gateways_operations.py index e470c69bcb576..05988408c7572 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_security_groups_operations.py index 0be403ef574f0..d6cde4e4427a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_available_endpoint_services_operations.py index 453f5dce7fcba..32a375caa10fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_azure_firewalls_operations.py index 2826b61612a5c..fc2852d1b135f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_bgp_service_communities_operations.py index ca7a4fd877fde..6fef8f5b31f03 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_connection_monitors_operations.py index 3f2ca6875027c..3f9a62c298b75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_ddos_protection_plans_operations.py index 0c89f5faa1691..9cc2484c378b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_default_security_rules_operations.py index 10a62d6ec4ffc..0a4a8a621ed1f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_authorizations_operations.py index 6bf647bd05423..34b3093cd3468 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_connections_operations.py index 9bb98edb6e30c..c98ae815f032b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -147,7 +147,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -169,7 +177,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -185,7 +193,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,11 +242,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +304,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -324,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +359,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_peerings_operations.py index ee0731384e0df..bc34384fd7bf0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuits_operations.py index 2a4e9526d8d28..3af455088405e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connection_peerings_operations.py index 16533abdbd64f..9fd541736b40b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connections_operations.py index dcaa7c145c3ef..42825a039948a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_service_providers_operations.py index bacbde9ada2b7..d9aa0b2a67dfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_hub_virtual_network_connections_operations.py index 449f0a4242fb3..1991b706e920d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_inbound_nat_rules_operations.py index 66517bcd2d135..bffa4daea2e5a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_backend_address_pools_operations.py index 999a40e65aeea..4d099e3c3f262 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 8d77e0f55f457..2cc45d0087af6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_load_balancing_rules_operations.py index 3c99fb3e7a394..1a763e3e83be9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_network_interfaces_operations.py index 070321f910054..6f4967e6f541c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_probes_operations.py index 49a574fd8a702..31dc9a501766e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancers_operations.py index bfd67db8edad3..e2a7925f725e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_local_network_gateways_operations.py index 7aa2c6fec4ca7..0849ccefb11e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_ip_configurations_operations.py index 86ee48948b20e..4a0e7d74e62f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_load_balancers_operations.py index 7258f2fa251d6..5ad9f459645ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interfaces_operations.py index d06695f7253b4..5a3c304dbaa81 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_management_client_operations.py index e1f87aff36b2a..0154b77d809c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_security_groups_operations.py index 5659f7b7d8d82..8e180480d6bd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_watchers_operations.py index 94ee570b08c5b..e8a0123d1bc8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_operations.py index 6d8a33dc0d01b..8cb0c0441077d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_packet_captures_operations.py index a4e8efe256d53..465da3109b534 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_public_ip_addresses_operations.py index c4fb0d5d8429f..2be533e9b1703 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filter_rules_operations.py index 4d9e4d337e2b9..3da670a4135c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filters_operations.py index 46e0b9eebfba2..5a495d8f74050 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_tables_operations.py index e49c74e55d2b8..0da731d931837 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_routes_operations.py index 5860cc9e796c6..66f51f54c5138 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_security_rules_operations.py index 437e8b27d0c43..aa4070d36cd05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_subnets_operations.py index a38ceb80de502..2c5ed804c3abc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_usages_operations.py index ef1ecb317c17c..8c8ec5ed32151 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_hubs_operations.py index 647070931e318..20a090f73bff5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateway_connections_operations.py index 4fe66436ac62e..64d3da5a1b561 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateways_operations.py index b29613192c97b..48e35b9069e1d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_peerings_operations.py index 0da56484f69c5..a4bf984aeebf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_networks_operations.py index b006159cd24c0..4f9f623f45949 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_wans_operations.py index 9d621a4018516..188bb20dadc2d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWANsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_connections_operations.py index 3752fb60a63e2..22cee7410ea9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_gateways_operations.py index 05dc41797a6c3..196ecf09dfd79 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_configuration_operations.py index e32233a7c8c20..fcb4e029f7f0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_operations.py index 42c5cc3c38ab9..dbab4b38643dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_metadata.json index 91f05f591c44a..ae4ab955a125d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -112,7 +113,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_07_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_network_management_client.py index 9dbe0de3bccb9..14be6bf85bd59 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/_network_management_client.py @@ -204,7 +204,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.azure_firewalls = AzureFirewallsOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/_network_management_client.py index acaf369adab7d..9c2bf22076ac3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/_network_management_client.py @@ -201,7 +201,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.azure_firewalls = AzureFirewallsOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_gateways_operations.py index e437a3672b936..9d3c5726ae428 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_security_groups_operations.py index 0de13eb1b6041..67d8de6971ebd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_available_endpoint_services_operations.py index 87e1a59750d95..b606932070f18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_azure_firewalls_operations.py index 6604e537239c5..3515bb0a15689 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_bgp_service_communities_operations.py index d4baf5427a33e..8157065981e02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_connection_monitors_operations.py index 8632a8fe157da..94ce85aa39bba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_ddos_protection_plans_operations.py index 7f086abea0a8b..b68798f0b83e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_default_security_rules_operations.py index 8f3c75925a566..c397a7e3d82df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_authorizations_operations.py index 1411ad6aab168..6d9ee90053bc0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_connections_operations.py index b45a4df573899..d7fa122861c00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -141,7 +141,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -162,7 +170,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +186,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,10 +235,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +296,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -315,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +350,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_peerings_operations.py index ba3468624f159..7d5d578f34f64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuits_operations.py index 6d51085c0f677..aab13897d349b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 0a1bcceb46de3..9966bae21bc17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connections_operations.py index ede6e0fb441da..6cd7a96a84f81 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_service_providers_operations.py index 603e709c9b4b1..b5620f09e614e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_hub_virtual_network_connections_operations.py index 90d043cb57e6a..222bfdea93d20 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_inbound_nat_rules_operations.py index ff17f83c44998..c3c348767a677 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 2728e563d3713..0000a3937a9c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 8c33ddccda4d5..3728c9d686607 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 33fb840193768..156faee07071c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_network_interfaces_operations.py index b7e32eca52d84..a4e75f6a95588 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_probes_operations.py index 34fcb49938d11..e07b27878cb8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancers_operations.py index 8046dd5c1afed..707acd6890319 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_local_network_gateways_operations.py index 48a5744dcf253..ee1988b215aa2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_ip_configurations_operations.py index f0d5438ead54b..b100a6ba11de3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_load_balancers_operations.py index fba41e544b072..c6c327296226c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py index 2913637541199..92b6fcb66b0aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_management_client_operations.py index 66de5d24b13ba..d320688f15d9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_07_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py index f70d01f32d98d..ec43b9494f7fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_watchers_operations.py index 76289f392cf48..44d9858837859 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_07_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_operations.py index 21c189b8c448b..159fca1f213ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_packet_captures_operations.py index 46cc54fdd2dd7..22ed6c445c5dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_addresses_operations.py index 1d941c9c1e0e4..03b159a1ccb22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_prefixes_operations.py index 3b6364383caea..de80cd2c5c11c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filter_rules_operations.py index 9346ba029cb65..e2ce274274679 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filters_operations.py index 4b2fb3feeca11..7cd157466ea73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_tables_operations.py index 1a3a32f6c90ab..ef57a3cd6439e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_routes_operations.py index 5500ad462e04a..1cfaca6f7eeb9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_security_rules_operations.py index 7916187cf722b..11b11c5d27b4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policies_operations.py index 6334032cb8022..d341f641e26a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 993ab9c528b59..8dbeea3e3ca5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_subnets_operations.py index 52386caffd2cd..98f75afa3d00d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_usages_operations.py index 78cdf0a775045..1cfcb897d9b4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_hubs_operations.py index b950fb724f3c6..41fba023a98ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateway_connections_operations.py index 2945c1add03b8..b2f119968a8d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateways_operations.py index 8502f98e5e010..5158fd21a2108 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -707,7 +731,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -762,7 +786,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -811,7 +835,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -829,7 +859,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -884,7 +914,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,7 +1080,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1064,8 +1106,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1158,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1136,7 +1178,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1161,7 +1203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1238,8 +1286,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1335,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1306,7 +1354,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1330,7 +1378,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1350,8 +1404,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1401,7 +1455,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1422,7 +1476,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1447,7 +1501,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1465,10 +1525,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1520,9 +1580,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1544,7 +1604,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1569,7 +1629,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1588,8 +1654,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1635,7 +1701,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1655,7 +1721,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1679,7 +1745,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1697,7 +1769,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_peerings_operations.py index f284739eb215c..0f04d8fd16c11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_networks_operations.py index 1e148b2408e01..0cb2d54b6a9bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: Optional[str] = None, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_07_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +668,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -662,7 +680,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_wans_operations.py index 0231052c651b7..fe0a31731f0cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWANsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_connections_operations.py index 8f95801eff745..85952b0431e92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_gateways_operations.py index e4d9baa2a1340..a3a03ff2f442c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_configuration_operations.py index c3e3aac75494f..ae522e656691f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_operations.py index 42c3c03d30126..30c189724e5af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_gateways_operations.py index e44c4cfefdc38..2b986815f6a1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_security_groups_operations.py index 0f2d3fdeac318..66fb779d3d497 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_available_endpoint_services_operations.py index dfc3d42cbbea5..af5736d9efd09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_azure_firewalls_operations.py index 4e8754fe3bb6f..3d384b24fcf50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_bgp_service_communities_operations.py index d0d94fef6e163..3d3d7c2d6f9d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_connection_monitors_operations.py index 4160144f43697..032308c1328b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_ddos_protection_plans_operations.py index c149bfb79c2c8..c3b91559e868f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_default_security_rules_operations.py index 77113b385fdf6..f60b11f996235 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_authorizations_operations.py index ebb39f89dbfcb..f95640e9b9023 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_connections_operations.py index abd7d0d82da93..3c427872f107f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -147,7 +147,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -169,7 +177,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -185,7 +193,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,11 +242,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +304,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -324,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +359,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_peerings_operations.py index 7397681a4d4e6..aee670164efcc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuits_operations.py index bbe132f153d46..1e3f1c43faa28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connection_peerings_operations.py index e1e8726f9c995..be07b03c26837 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connections_operations.py index ae64956edac6b..977cc09b73638 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_service_providers_operations.py index f4d8da866d3c5..31ad8a8fcb4ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_hub_virtual_network_connections_operations.py index 174cc963eb76e..b1503217a93c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_inbound_nat_rules_operations.py index ba53a00cce745..52f7f6467190f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_backend_address_pools_operations.py index 59eaf012a1f11..553eb62069059 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 9cb374914df15..2be684261b366 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_load_balancing_rules_operations.py index dfeaef6789863..36631c342160b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_network_interfaces_operations.py index 387a45bdaaedc..1589b17a50759 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_probes_operations.py index 8cbab5ae869cd..37a298ba22eaf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancers_operations.py index bfcbfd6b28f6f..e923e9811e1bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_local_network_gateways_operations.py index 9efda4cc23296..167e94f2f447a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_ip_configurations_operations.py index e907d8f1a7abc..6546a04061324 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_load_balancers_operations.py index 907873bdaf214..acd4fa2195970 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interfaces_operations.py index f0417d7573cc9..cc4770cf96b45 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_management_client_operations.py index 4a474eeee92a7..943ea1998dd56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_07_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_security_groups_operations.py index 6e8b2e876e238..5d52b5229bd23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_watchers_operations.py index 21918e6729529..8ca08ea0ff82f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_07_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_operations.py index 061a945406fc5..4ac1f996f07f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_packet_captures_operations.py index 925b4e7e780b4..3fd4fee0c166d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_addresses_operations.py index a1990f6b6294b..892a54e2a58af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_prefixes_operations.py index f736947afa737..2b96d2d9e2774 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filter_rules_operations.py index ce969cf14d46d..cf6f23389128f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filters_operations.py index b71568227dff6..c78d9042ab87b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py index 450283f0302b2..6cc35ec222b43 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_routes_operations.py index ca72b66d1e1e4..129944c727e33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_security_rules_operations.py index d01bc449f22ff..13e10c9192ade 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policies_operations.py index 9bcda847c6bc0..427db6cf6a8c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policy_definitions_operations.py index c1f7689aab62d..9c00ddb2b1bfe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_subnets_operations.py index 4081f86e59a89..329e27594a094 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_usages_operations.py index 4a7d00ea5eafc..7867d84114efe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_hubs_operations.py index abef4aff03255..9f45b2a964c6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateway_connections_operations.py index 919a0df8cd84b..16d9d5834627e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateways_operations.py index 7bc4e2c0112af..5d7332548eb58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -722,7 +746,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -778,7 +802,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -828,7 +852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -846,7 +876,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -902,7 +932,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -952,7 +982,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1086,8 +1128,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1181,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1159,7 +1201,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1184,7 +1226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1263,8 +1311,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1313,7 +1361,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1332,7 +1380,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1356,7 +1404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1377,8 +1431,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1429,7 +1483,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1450,7 +1504,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1475,7 +1529,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1493,11 +1553,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1549,10 +1609,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1574,7 +1634,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1599,7 +1659,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1619,8 +1685,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1667,7 +1733,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1687,7 +1753,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1711,7 +1777,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1729,7 +1801,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_peerings_operations.py index 795bd51b62cb6..8bd2cd7eddd30 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_networks_operations.py index edb9bdf887475..f9943c9bc95f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_07_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -665,7 +683,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -677,7 +695,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_wans_operations.py index 312fbbca63074..7d89d89d692e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWANsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_connections_operations.py index dfafef4ca5b6e..bb68e8c95264a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_gateways_operations.py index 6d3bd338ee35c..cc10e82b8cdb7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_configuration_operations.py index 3db2cc9378b0f..91e80e906ba14 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_operations.py index 33590ba395062..f0ccd741c1e18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_metadata.json index 37cd33be659bb..42f7724eec2e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -127,7 +128,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_08_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -139,7 +140,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_network_management_client.py index 821ed66218791..19f4c92e1b89b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/_network_management_client.py @@ -249,7 +249,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/_network_management_client.py index 084680a95dc3a..a0890a4007dd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/_network_management_client.py @@ -246,7 +246,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_gateways_operations.py index 74630b625b9d5..be7e194448422 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_security_groups_operations.py index 04dfef893cdbc..c3285903f8f17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_delegations_operations.py index 252a3c99b49e6..53b16f5ea2ac8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_endpoint_services_operations.py index e451683ab4ce0..509f1d30d06fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_resource_group_delegations_operations.py index 84b1f60bfa53f..658fa56d075d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 00947084a15b4..250a1c578b792 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewalls_operations.py index f59fff7d4b48e..e58f7be75efc3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_bgp_service_communities_operations.py index 25e092a47687b..3c56b64a17c2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_connection_monitors_operations.py index 588b7456d3761..734f795cc8b9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_ddos_protection_plans_operations.py index 8a7c82df99bc4..c01804a6aa2c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_default_security_rules_operations.py index 603cecf95de8f..99a77fc11ace9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_authorizations_operations.py index 43f63ff43a7a4..0ef9b4af5c0ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_connections_operations.py index c87decc95f02f..fbb1b229fb47c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -141,7 +141,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -162,7 +170,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +186,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,10 +235,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +296,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -315,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +350,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_peerings_operations.py index 5fd0deea1ee16..bf8483886b238 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuits_operations.py index 4d3a1c9823cdb..03d48c6bac4da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_connections_operations.py index 65e9e6dadcc05..3890a0e019409 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 84e18d1b928b6..d02b1ed4227f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connections_operations.py index c7f391c740537..5b3d76d5f537c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_gateways_operations.py index 685a26c62eac3..68d50832b449a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_links_operations.py index 8364f502c748d..aea4e08588dca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_locations_operations.py index b9f6fd95dab50..691ccaba5605f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_operations.py index ee52ccc4caa4a..39f0875c40d48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_service_providers_operations.py index a7c8c61df2a5f..960ce508db1f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_hub_virtual_network_connections_operations.py index 8d4561be42a47..a7b058f5a2df4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_inbound_nat_rules_operations.py index ab830bed6109a..94448a779fb6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_interface_endpoints_operations.py index b8ec8708c95cc..421290b75f5b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InterfaceEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( interface_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InterfaceEndpoint": + ) -> "_models.InterfaceEndpoint": """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> "models.InterfaceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + ) -> "_models.InterfaceEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> AsyncLROPoller["models.InterfaceEndpoint"]: + ) -> AsyncLROPoller["_models.InterfaceEndpoint"]: """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py index da4b81747c75e..7c63f86dd7f22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 13598be173062..006f819fc5baa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 07853cdb81aac..80034f67d188e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_network_interfaces_operations.py index 559dc54a88673..87bd6ae68db8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_outbound_rules_operations.py index cfa0d533dc287..1056230b475df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_probes_operations.py index 9751c65e6ea8f..38a6365b58b4f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancers_operations.py index 64c74527f0e4a..7ceef9094f032 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_local_network_gateways_operations.py index dce8117e0d6a5..fb55355b09d74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_ip_configurations_operations.py index 69bcffda898b0..7f4f5eeede0ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_load_balancers_operations.py index aa5e9b55dfc10..b55f74d982ee5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_tap_configurations_operations.py index 7510063f70467..dd4d2ce9e5db1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interfaces_operations.py index 7af47376cbe44..15ea7b7ab5931 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_management_client_operations.py index a8cc676b6cfe5..bd3bffaf9c180 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_08_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_profiles_operations.py index a728fb40f812b..4a41a96df756c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_security_groups_operations.py index d840485f1a340..1ef9575618cb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_watchers_operations.py index e971ad14c32e6..6b730adf5f453 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_08_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_operations.py index e2a7fbf56bd72..99620df97230f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_gateways_operations.py index 47a7425b29cfb..b6e03ceab29cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_server_configurations_operations.py index 72edc03e712b9..0a7dcd299a072 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_packet_captures_operations.py index 57295d2280397..d542bc53d768c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_addresses_operations.py index 5191cc0a2fc3e..fc37c512c538a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_prefixes_operations.py index fb1562ddc5bed..021c28b33858b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py index 574ea42f6af59..e37fc0f553fee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filters_operations.py index a325f5b57d286..19cb825b2059b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_tables_operations.py index 6e17c7bf99e40..569cc7a761735 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_routes_operations.py index be09c764e8234..4a19e71af2fb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_security_rules_operations.py index 9f5bf429281df..7d63b7be8255b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policies_operations.py index 40161155db55b..eec384e29ba7f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py index f8723295d412d..12cc17e7c5fe8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_subnets_operations.py index 34ac5b9ecfa69..79fab36b762b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_usages_operations.py index 4ae3005315740..6f4001c36231a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_hubs_operations.py index 59af400af8d64..49658127a1e40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateway_connections_operations.py index 355417ed6e0f0..2d9864fa1a4ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateways_operations.py index 3f3658ee3d93b..980ecb15895fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_peerings_operations.py index 1c546c6e51297..726e15d84a16c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_taps_operations.py index bb1ccbdab7599..97e4599a65911 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_networks_operations.py index 6cd932312155a..79c1e64d0d638 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_08_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_wans_operations.py index fd37098c1b2ff..053a03fcaa6e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_connections_operations.py index 71a61fe84c089..f97d954024f32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_gateways_operations.py index f9caa88a4e8ab..86466f2f35367 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_configuration_operations.py index b80f0dbef0061..13ec9e891254f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_operations.py index 256115e8e95b0..6f42ac8bcf255 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_gateways_operations.py index 6926dbd34e087..7f2dce28a71ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_security_groups_operations.py index 88a9fe02acfe5..d7f7a5638f87a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_delegations_operations.py index 04fd406efc892..b74d0cac35820 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_endpoint_services_operations.py index 102630b099f36..f6898cca389b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_resource_group_delegations_operations.py index 53e6c952e7a12..e4ff9452a889f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewall_fqdn_tags_operations.py index fd5e68751f691..6b94270b210a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewalls_operations.py index 47c99405a774a..abaebfb477193 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_bgp_service_communities_operations.py index f41f3e56190b5..d8daa59805a6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_connection_monitors_operations.py index e6426fb6f2154..d8a27d76f5adf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_ddos_protection_plans_operations.py index af12428b073f9..9b7d0c53b391f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_default_security_rules_operations.py index 1e03ebdd8c7b9..141dea924240d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_authorizations_operations.py index 4b71f0a8a505c..24965d2e5f00e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_connections_operations.py index 70fc064d66dc8..056c1630de115 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -147,7 +147,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -169,7 +177,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -185,7 +193,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,11 +242,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +304,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -324,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +359,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_peerings_operations.py index d2ee7602e108f..657ef814c3914 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuits_operations.py index 459c8e1ddf6d3..c2f9ed0ed033a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_connections_operations.py index 5bdfa4fc98f4a..9446bd4150989 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connection_peerings_operations.py index 83787688a077d..29b347881ce03 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connections_operations.py index b019b18440d04..a91e6234463bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_gateways_operations.py index 762731003ca3e..23cb0d62a049e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_links_operations.py index cf6fa95d38f28..841ba43a5c81f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_locations_operations.py index 5b52069726fda..c0ea2a69e77a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_operations.py index cb60c0e401089..3f11f6928e0a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_service_providers_operations.py index 6fc838445e3ee..533bd266b8b35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_hub_virtual_network_connections_operations.py index 45b6dd4602288..ab8ffea2a6748 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_inbound_nat_rules_operations.py index 753cc6fe358da..c10d6a505dfb9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_interface_endpoints_operations.py index 32ccf3721a1fd..a293e3f5b66ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InterfaceEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" + # type: (...) -> "_models.InterfaceEndpoint" """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + # type: (...) -> "_models.InterfaceEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InterfaceEndpoint"] + # type: (...) -> LROPoller["_models.InterfaceEndpoint"] """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_backend_address_pools_operations.py index bc56583d0a397..00dbbc2eafda5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py index a4d55e520f3cf..205320f69c838 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_load_balancing_rules_operations.py index df9fa9550ff2e..c221c5517f46d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_network_interfaces_operations.py index 3816b02510c92..3d038dea14efc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_outbound_rules_operations.py index 1aabc2e7d6140..87d575558ccab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_probes_operations.py index 401d715dcc91b..77cf0f0966771 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancers_operations.py index 1226a8db4ae3c..04c5ec8b704df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_local_network_gateways_operations.py index 4bce953953fd2..d112dcc78ca61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_ip_configurations_operations.py index 70942092221ec..f9ca7a7cc1ade 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_load_balancers_operations.py index 92fef50c48a34..98f8a9798d753 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_tap_configurations_operations.py index 70499580974b3..abd2f257542c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interfaces_operations.py index e0837891ea3d7..5058af65b2fd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_management_client_operations.py index c160f5cfc4bec..a67fb08043d40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_08_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_profiles_operations.py index e6e5645f54662..aa4e9e0eaa8ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_security_groups_operations.py index fa4d9809b4acc..50fd41b66ae5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_watchers_operations.py index 16862a392af36..ead5648b10dd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_08_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_operations.py index 7e47582a4297a..fd781e3a0a301 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py index a0d70e9d8c874..8b27536f7aef2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_server_configurations_operations.py index a0642ed7cd81d..b486512cb3647 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_packet_captures_operations.py index 13f7f8e7cf0a1..b5ebdbee4e3cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_addresses_operations.py index 72e228e777f9f..78f895e20a3fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_prefixes_operations.py index d348f24e2db16..7ec8a8cc3f03e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filter_rules_operations.py index 6b7bafb2c67f2..a3d6dde8ca1c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filters_operations.py index f3c6cf7fd98a2..633f0588fb3ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_tables_operations.py index 30193f7f5fe4c..b21f78ad8716f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_routes_operations.py index 9cc7adfeb6258..b801ce2e672f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_security_rules_operations.py index a00b509b4868f..a137fe202c919 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policies_operations.py index 49a626ea1ecb2..9adc14951d6f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py index 65d19792d0498..a29a6eaa69974 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_subnets_operations.py index a950b49602e14..c6df432eeaa36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_usages_operations.py index 81332320bb40c..f18bd4ea67f50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_hubs_operations.py index a51f3c0cc0197..682b60ad04d1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateway_connections_operations.py index ef85558f5cc1f..2693738ce463e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateways_operations.py index fe4c2e5b46e80..ed06543466834 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_peerings_operations.py index 4d06d384d1820..28562ba03f7cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_taps_operations.py index 2cb9b74696324..e04dc3311a113 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_networks_operations.py index 88370cc6e8ccc..7449d46683b3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_08_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_wans_operations.py index 550c58c48409c..d12f942cd0fb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_connections_operations.py index 94ffd3fad55ca..303a5e2a5f997 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_gateways_operations.py index a7898ce456b9c..f9e506122818f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_configuration_operations.py index 5a83781e257ae..224e38ac500ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_operations.py index c91cf3006ecee..cb5fb4ca178c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_metadata.json index 43f706ccc3ca3..d7ef18017c50a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -127,7 +128,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_10_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -139,7 +140,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_network_management_client.py index 3990027af0399..fecd8dbd7f03d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/_network_management_client.py @@ -249,7 +249,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/_network_management_client.py index 953843aaa2a97..e16c9cabae2cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/_network_management_client.py @@ -246,7 +246,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_gateways_operations.py index 01d689ece54c3..cf8a30bc238ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -897,7 +933,7 @@ def get_long_running_output(pipeline_response): async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -905,7 +941,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -947,7 +983,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -955,7 +991,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -997,7 +1033,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1005,7 +1041,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1064,7 +1100,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1074,7 +1110,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_security_groups_operations.py index f1d8197139633..106b759282191 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +347,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_delegations_operations.py index 26939f312b35e..de2eada48878b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_endpoint_services_operations.py index 1c53c60f9c6c5..ba7cdf4110052 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_resource_group_delegations_operations.py index b30337c7f80fe..2e164cd2ba774 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index c1b92699bfbd4..7a7c70931d75b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewalls_operations.py index e2a1ebbcce4df..0150259807fa0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_bgp_service_communities_operations.py index 1757271444add..d809b2b1365aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_connection_monitors_operations.py index cc5f245d1afb2..dd51167c78a34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_ddos_protection_plans_operations.py index bcbfca56bf94b..e336e5ec1873c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_default_security_rules_operations.py index 067b70abb44b8..bd95adfce2c72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_authorizations_operations.py index d5716397bd936..09064ac9f3343 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_connections_operations.py index 141d3be23bb9c..17c0ca8ea7889 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_peerings_operations.py index e09bbeaa0d29d..2fcfaa8cdafe5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuits_operations.py index c71b0457328c3..df4508c498762 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_connections_operations.py index 7eedc7761a49b..1263cf5d9f529 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connection_peerings_operations.py index ea8460b6293d6..8d2fd23c6375d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connections_operations.py index 6460b99385b97..bd165774d3fdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_gateways_operations.py index d4af685c4fec5..77ccb540f326d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_links_operations.py index 5d165cece071c..056980f64dda4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py index 1c3c0ac91f87c..d1370396d7bac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_operations.py index 1791174ef42e6..860465d5743fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_service_providers_operations.py index 2e593d07ba9bc..1373df3a7b439 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_hub_virtual_network_connections_operations.py index cbe1225698930..9cc62a433aceb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_inbound_nat_rules_operations.py index ceaac4b1cede3..4810bb2cab884 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_interface_endpoints_operations.py index c73407914aa11..87ba71fbf42f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InterfaceEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( interface_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InterfaceEndpoint": + ) -> "_models.InterfaceEndpoint": """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> "models.InterfaceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + ) -> "_models.InterfaceEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> AsyncLROPoller["models.InterfaceEndpoint"]: + ) -> AsyncLROPoller["_models.InterfaceEndpoint"]: """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 7ef7f0efbacf6..f9d33beb3697a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 0b5db48da9f58..9118238fcea3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 5332d82498b96..8afd96ab93343 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_network_interfaces_operations.py index 5171375cc3a10..60b0c974bd8fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_outbound_rules_operations.py index 74117746553c4..0db1a9ade3f98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_probes_operations.py index 50948eaf20e31..481215289d858 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancers_operations.py index 6b40fe0c97d8e..52e6036072c98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_local_network_gateways_operations.py index e4a310678271e..0f9f405bd71b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_ip_configurations_operations.py index ffac44b3c7bab..d1ebfd52d7169 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_load_balancers_operations.py index 3bde3353153f8..1434d4f5c2f1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_tap_configurations_operations.py index ae3f73656a04a..64091d64e1067 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interfaces_operations.py index 8d51b9330b2fb..982ac39b7b457 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_management_client_operations.py index de47c32bbbe56..2a27942901fb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_10_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_profiles_operations.py index 2061f027d1ab6..5dac7f46a87da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_security_groups_operations.py index 1c9748199b6e8..412f187aa94b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_watchers_operations.py index b1fc22cd30911..1dadd0b441e75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_10_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_operations.py index 3e5a5c8d738f9..626f7ec34fa89 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_gateways_operations.py index 2a4fff5813a52..0ef29a00ab1d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_server_configurations_operations.py index fa3cd54624403..bf42b466392ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_packet_captures_operations.py index 5ba8e4be4590f..2a890b6ce9ef7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_addresses_operations.py index 8b6eb1abbb897..f00c88ef751d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_prefixes_operations.py index 129f2b5b166ed..7086b0afbf5ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filter_rules_operations.py index 418cbf2097a68..12cb5acc64851 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filters_operations.py index b5fac8f281a71..448587dd82325 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_tables_operations.py index 6f890db15dd36..a603274380e99 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_routes_operations.py index 4f67e87244b7e..d39c62a3a707e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_security_rules_operations.py index c3be777034648..8cd262a8aa6d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policies_operations.py index df4143036b18a..17c54f06f69e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 6f9630108c98f..1b41f14b1867d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_subnets_operations.py index a7e00fb894928..75d0cc76a23fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_usages_operations.py index fb3e8b6907e38..18d28a6f9d9f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_hubs_operations.py index cc8c26c119200..2142f8a87b513 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateway_connections_operations.py index 9e12d08cf4922..a43eab0d9a3f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateways_operations.py index 5a0432df43303..16fff7ce9faaa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_peerings_operations.py index 27b4261721e63..0823b18804f8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_taps_operations.py index 796c2e235099d..eda3291e48536 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_networks_operations.py index 06d4c0157148f..5008eca8c3d25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_10_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_wans_operations.py index fe37427260d43..f4d840fb6d338 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_connections_operations.py index 05f01a23a9f82..021ad321e14ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_gateways_operations.py index d1377c8e3b64e..97da78eccd1e5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_configuration_operations.py index c984becf6aef0..6f3bffe151e64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_operations.py index 96cb50357a8b3..37b45812e8076 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_gateways_operations.py index 408b213bb9bf4..4960a0f8a93e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,7 +953,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -925,7 +961,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +1004,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -976,7 +1012,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1019,7 +1055,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1063,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1087,7 +1123,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1097,7 +1133,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_security_groups_operations.py index 1873eb23e7729..36bd49ce70673 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -345,7 +357,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_delegations_operations.py index 21d699c7e5599..e258cf43afaef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_endpoint_services_operations.py index 09413e18f5fcd..5d445d252611d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_resource_group_delegations_operations.py index ec4e6da0a77f7..8193433417f65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewall_fqdn_tags_operations.py index 133f1f64a22c7..48040d5054e7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewalls_operations.py index c561ef67aeb37..5d2623cd4f12d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_bgp_service_communities_operations.py index 68f76daba3a17..b366d1c20c283 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_connection_monitors_operations.py index 402e1699b2c97..ba4d3500a7b0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_ddos_protection_plans_operations.py index 20409492a9a5c..4655d69f3c4cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_default_security_rules_operations.py index 5f5952a275dd9..2ad72e4a29df5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_authorizations_operations.py index a4b21a07f1573..59aa6c90a7d8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_connections_operations.py index 30aa854ab6fca..26e39cc150a95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_peerings_operations.py index ce2b2480fb854..f055c91a23670 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuits_operations.py index c8ad69ac79b6d..c9979355a4423 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_connections_operations.py index 33517f89d59d4..10bd044f3bf20 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connection_peerings_operations.py index 7b8aad80360ff..f29684d0ac0f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connections_operations.py index 4b896638d612c..6e6f3d37b4224 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_gateways_operations.py index f3f5a4a589da0..f1764c9aaf349 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_links_operations.py index 0d345ff66f176..e3ee4bc87c998 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_locations_operations.py index a0c831f9d27f8..5664dca5be99f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_operations.py index d01338e40efef..5123fc7838d01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_service_providers_operations.py index 640538e767354..7830564ec31cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_hub_virtual_network_connections_operations.py index 3caabeca27787..541e32ed70ecd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_inbound_nat_rules_operations.py index 1877a7cc7a8c3..7c4709a574ff9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_interface_endpoints_operations.py index 9d2c7c9c89f39..51ba9b19ac47f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InterfaceEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" + # type: (...) -> "_models.InterfaceEndpoint" """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + # type: (...) -> "_models.InterfaceEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InterfaceEndpoint"] + # type: (...) -> LROPoller["_models.InterfaceEndpoint"] """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_backend_address_pools_operations.py index 8a9954ce60f52..09b55397c89bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py index f47d117936fb3..fd9acda99b7bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_load_balancing_rules_operations.py index 57a05e64bf968..54f7999b61a18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_network_interfaces_operations.py index 3e96661652ef3..d6b0035fea0e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_outbound_rules_operations.py index 880e02aece906..32ddd389d39cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_probes_operations.py index 0af880da30ec3..0bca52a70a5a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancers_operations.py index 812f2e87cf1d0..195aa4d1ec127 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_local_network_gateways_operations.py index b47071a227e93..4d53822c09508 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_ip_configurations_operations.py index 3ed761db8b493..f26a82a1bd7f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_load_balancers_operations.py index 3b5221bb32c6d..8caa2d4dff012 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_tap_configurations_operations.py index ead115eb30e57..ed9ca967d6614 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interfaces_operations.py index 51840c098b7df..47f8726bafd55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_management_client_operations.py index 3add739779c3a..38b2ea73a8d62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_10_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_profiles_operations.py index f7f2400e2e5bb..c83adbf9f087b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_security_groups_operations.py index 989350609c04a..3df428f7d010c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_watchers_operations.py index 894b2caaa616d..c0d4b41f325a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_10_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_operations.py index 4302105039217..f508c707e6941 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_gateways_operations.py index 2cd3e47ae72ad..70de85c05aeb7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_server_configurations_operations.py index 1b5e73e6131b3..05c3335ef4701 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_packet_captures_operations.py index b719f82f49163..3aeffce7f62e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_addresses_operations.py index dd967d6200040..0a3a4c1e8c4ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_prefixes_operations.py index 9e75874a83110..b7bb7a9506abc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filter_rules_operations.py index 495752fcc5f7e..3f5593888e30a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filters_operations.py index c8767be23c68d..bdbfb99f5dec4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_tables_operations.py index ec68237cb2e0f..0f476bce020a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_routes_operations.py index 2e156722f4b48..f0e7389bd9216 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_security_rules_operations.py index d28de9f070177..a8fa85d3ccf7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policies_operations.py index d1a7b6b077f69..a08144dd654cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policy_definitions_operations.py index 1140080db6828..60f242c938fbb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_subnets_operations.py index 3e9f085988bf0..9325e908c9021 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_usages_operations.py index bf8e9ca28914c..730cebc5cf6ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_hubs_operations.py index f2affa92871dc..885065f452b1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateway_connections_operations.py index a2da3eb3ae1f6..5cbc54140d915 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateways_operations.py index 73886ff320b79..cf7a19f1ecec7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_peerings_operations.py index 36f8f1e39bff5..3facc8cf317b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_taps_operations.py index 8e6ebbfbc7c23..d71823cd56805 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_networks_operations.py index 836dcb72691a2..f3662565e3859 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_10_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_wans_operations.py index 50e24fc951d46..d054c90136fbb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_connections_operations.py index 02bf53f43f24d..5fde2545fadb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_gateways_operations.py index 6a597b3927e44..bc04ed119c4ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_configuration_operations.py index 29c1367a2d71d..987fe0c72816b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_operations.py index f0afad1a09ce7..4110007644c3d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_metadata.json index 8e1ddc7c9a191..f19cf1da72f9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -128,7 +129,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_11_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -140,7 +141,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_network_management_client.py index 7797688beb55d..ba3c6cf65b96e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/_network_management_client.py @@ -252,7 +252,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/_network_management_client.py index 85d2c21a17111..751f5cd902dbb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/_network_management_client.py @@ -249,7 +249,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_gateways_operations.py index 1a3e76130df89..bdf0f19e78871 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -934,7 +970,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -985,7 +1021,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1036,7 +1072,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1050,7 +1086,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1058,7 +1094,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1100,7 +1136,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1108,7 +1144,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1150,7 +1186,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1158,7 +1194,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1253,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1227,7 +1263,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_security_groups_operations.py index 942300e26f0b6..c7fc2587f661a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_delegations_operations.py index bd0f0b6e8e5c9..1b0fdd8aec2db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_endpoint_services_operations.py index 09aa8682fe31d..2638e460ca16c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_resource_group_delegations_operations.py index 34567fe7852e6..f2ea8866cb7d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 1c94b0d083a6e..2f5fa52565e4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewalls_operations.py index bf148be62bff9..c0bfce115dc73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_bgp_service_communities_operations.py index b9e2e1b80b1e0..6ad76985b22b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_connection_monitors_operations.py index 074a515635f4f..ac9e94bec1dba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_custom_policies_operations.py index 3b2da49c86b9f..1473783c260b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_protection_plans_operations.py index eb5658d095be9..a0fb0b39c32f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_default_security_rules_operations.py index 7e56394254ba3..1e1bcb2f85e02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_authorizations_operations.py index 1da883f13b129..47d626cc5a29a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_connections_operations.py index 870f451699152..5e258138c5a85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_peerings_operations.py index 57d24c5f2d7c4..f4a5db0743543 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuits_operations.py index 58ac01e49bf29..1e30ab645cbc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_connections_operations.py index 106de8c39f9f2..f8aef2ca09a16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py index a4e4b5bbc0db8..9f7a229a6ec40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connections_operations.py index 3ba0ea2aa0fc8..26621a17c30a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_gateways_operations.py index 6e165c126011d..319b0c8925f46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_links_operations.py index ed715c6dd25e7..522f4d5a7d9c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_locations_operations.py index 0f2c19acac292..32e6a26897abd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py index 1c1e69935306e..bab4c8fa8759f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_service_providers_operations.py index 5c4a362ed8cd3..7f97771fe0b6f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py index 2344c09634e64..1e94f605ec753 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_inbound_nat_rules_operations.py index d2139bc94bbba..d9b74bcefedf8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_interface_endpoints_operations.py index 77566c1a64c8b..8aea8107121ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InterfaceEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( interface_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InterfaceEndpoint": + ) -> "_models.InterfaceEndpoint": """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> "models.InterfaceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + ) -> "_models.InterfaceEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> AsyncLROPoller["models.InterfaceEndpoint"]: + ) -> AsyncLROPoller["_models.InterfaceEndpoint"]: """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 6ff80fae9eb58..c22a2e77571c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index b0f39f761f51c..657da1a3d7696 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index f55182d6508d7..f9f4a75a80655 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_network_interfaces_operations.py index 5e351840793d4..ca862cd9897d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py index ec24f5697c380..8c836867ce162 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_probes_operations.py index 39c4f4a481407..550477eb382ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancers_operations.py index 1ae6b70d59fb4..71604e0904a31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_local_network_gateways_operations.py index 1e6d180ef3985..80121eefd774b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_ip_configurations_operations.py index 7a3076386ff71..0441579f38097 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_load_balancers_operations.py index 12b788b033480..a6020e8837656 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_tap_configurations_operations.py index b29d19f509084..2f50aec2829fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interfaces_operations.py index 0889e871c6f3a..95bb6698c0375 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_management_client_operations.py index 7d83fa233165a..f856b94ff47c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_11_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_profiles_operations.py index 91b81bf8e4ec7..073b0dc0f797c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_security_groups_operations.py index 87427542f4bcf..9de56c08cc717 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_watchers_operations.py index 53f6463e15153..776dbcb0507ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_11_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_operations.py index 0f6648b254f97..44e94e90d594b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_gateways_operations.py index 1d52f47549e5f..6258738f5d74a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_server_configurations_operations.py index 54a50758b110a..3bc48901c4681 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_packet_captures_operations.py index 03ca84d3adfae..28d8f4ab0ea96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_addresses_operations.py index c83d47eff55bb..79de0e6b8836b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_prefixes_operations.py index c7b31ac51d25d..610e71417230c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filter_rules_operations.py index 976979330b5b7..8b8e424090445 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filters_operations.py index 5a69cfe55a2c8..72f26fc1631be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_tables_operations.py index 377f9644b7e79..8314f1d349a38 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_routes_operations.py index 059d4d98541fb..d47dbc40d170a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_security_rules_operations.py index e0af49f0a92af..d6e2b2ca913bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policies_operations.py index b8d7213bdd84d..47c16eecdee47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py index bd9745a3cfb1e..a3ee9b84cc640 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_subnets_operations.py index da0e47c081a65..9c94fdfabddb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_usages_operations.py index e0cb6ede05703..2d8439049a12b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_hubs_operations.py index ac875c0861ef3..1e462b7357f0a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateway_connections_operations.py index e91cbe76ed502..c1b651e5e2671 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateways_operations.py index 4e154a155a32b..d6f0174221b03 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_peerings_operations.py index 9406ced08a1f8..ae88fe462137a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_taps_operations.py index d864badbd93dc..6995fa1de98fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_networks_operations.py index 2cca9ab523a5f..35cabd017579b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_11_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_wans_operations.py index 0cc6d0438ed63..430987cac9e74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_connections_operations.py index 4eedf5ac17c4c..f2e9403074451 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_gateways_operations.py index f835cc4b5ab3a..44fd313ba32ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_configuration_operations.py index ffd9c25bb6074..cc7a1d3c64a86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_operations.py index dcc7ccda82837..728356979f5e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_gateways_operations.py index be3d980af5459..359892ddc1819 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -954,7 +990,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1006,7 +1042,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1058,7 +1094,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1073,7 +1109,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1081,7 +1117,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1124,7 +1160,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1132,7 +1168,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1175,7 +1211,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1183,7 +1219,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1243,7 +1279,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1253,7 +1289,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_security_groups_operations.py index d4620f7740938..be5438e0d0c4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_delegations_operations.py index 7632e459cb387..d76f80239912e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_endpoint_services_operations.py index 5d41dbff383a2..f0869ffb5223f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_resource_group_delegations_operations.py index bd7a939265459..9df0a3f5e1242 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewall_fqdn_tags_operations.py index 57e3895834134..bec59d4284a41 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewalls_operations.py index 6ea177b2a70eb..19855872c2159 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_bgp_service_communities_operations.py index b9333af99afea..35a9407812c00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_connection_monitors_operations.py index 74d8eb08d6860..aec5d3838cbd5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_custom_policies_operations.py index 5fb5aa7387216..b6b9d1d1f0696 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_protection_plans_operations.py index 61e8dea980811..a0eba74005bd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_default_security_rules_operations.py index b62b22d8b070b..74db0189db87c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_authorizations_operations.py index af3049a104bf6..5e94905df37c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_connections_operations.py index fc25eaffbe50e..62613ce01d43d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_peerings_operations.py index 530df8b870eb2..a1d56715c5549 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuits_operations.py index 324bb1bd5883b..bfb0dfda77988 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_connections_operations.py index 1f3c70d853408..acc082e99c31d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connection_peerings_operations.py index 010dc89691f0c..c1a00e0f98e6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connections_operations.py index 1c9a85fa3b385..7d7c94f73340b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_gateways_operations.py index abd4c614c5d8f..1d9d618d3df3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_links_operations.py index ec83b95f01701..16b9b8c62f5b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_locations_operations.py index 1be413498cef4..3ccf9bccc6a3a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_operations.py index 53dee5528e8a8..a8c492a52b13f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_service_providers_operations.py index fab8f8d65a742..adeb6867f1b2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_hub_virtual_network_connections_operations.py index f1c3164bdcbc0..a1d0d7ce66db8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_inbound_nat_rules_operations.py index 3b7c52ecc7414..49fef19ca2a00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py index 240fb16c4726c..795c2af8db437 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InterfaceEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" + # type: (...) -> "_models.InterfaceEndpoint" """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + # type: (...) -> "_models.InterfaceEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InterfaceEndpoint"] + # type: (...) -> LROPoller["_models.InterfaceEndpoint"] """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_backend_address_pools_operations.py index 0c3af8067ca29..485f595047a18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py index ce0fa0857ef9e..8549ad2ca4f42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_load_balancing_rules_operations.py index 3d61dd063faed..124c5e905bd0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_network_interfaces_operations.py index 54b8567d2e841..f674134eb3ec5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_outbound_rules_operations.py index 48e3f8607c01e..2beae01f91f37 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_probes_operations.py index 8c02620dcafd1..aa3661b64c7da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancers_operations.py index 1d4deeb77b23d..f0580a02674a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_local_network_gateways_operations.py index fe786e4c45849..3796f7e97d853 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_ip_configurations_operations.py index 9970fc5980e94..3acd8a0cbd1b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_load_balancers_operations.py index df8dc561b03cc..098ef6f3699c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_tap_configurations_operations.py index 7d89df37c9ea3..c83a6c4fb1cc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interfaces_operations.py index 117cbd276947c..292487c7c2e4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_management_client_operations.py index b4ca63e293b64..d99440191e8fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_11_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_profiles_operations.py index 3d35abbe10a42..e84d00b741113 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_security_groups_operations.py index e7fc63ec4efbe..7362502cb4c02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_watchers_operations.py index dca3fcc598bfd..92cf99815ed71 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_11_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_operations.py index a411cffbc102d..cb88cb9e08780 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_gateways_operations.py index 3710a6309a72b..9ef11c7e8a60a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_server_configurations_operations.py index 1c52d50df1666..bd7044b0f0a8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_packet_captures_operations.py index 6c9c9b93732ae..f69f7e71b2bc0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_addresses_operations.py index 36898882e384c..63514937e1d06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_prefixes_operations.py index e4b72ddb42d2a..370f4ef4bdccd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filter_rules_operations.py index 1eb2690820883..38aa469d39d38 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filters_operations.py index c856449bb66b4..560c13d63efca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_tables_operations.py index c13b5a3314458..9add02403771e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_routes_operations.py index 87aba3b0b7530..627e566988887 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_security_rules_operations.py index 45caef29ea7a5..8f0741187c483 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policies_operations.py index 536c9fc03800e..6ee173058d5c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policy_definitions_operations.py index 3c21f93e0f8ad..644caff1de5a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_subnets_operations.py index fca90a8e3cad4..282946d2f2a6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_usages_operations.py index d3be82cddc7f7..830828defb4ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_hubs_operations.py index 60bab0bc892de..c6c55f257e05f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateway_connections_operations.py index b82a01a11bb10..24b8ea6894d05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateways_operations.py index afbb9ef85a490..f26945584c005 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_peerings_operations.py index 0faeaed056205..05a24367d8e27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_taps_operations.py index deff41b5074ef..90b10a4757204 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_networks_operations.py index 731ca953b32d0..435f77814b2c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_11_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_wans_operations.py index 533cb64822e71..69e6ef94feb94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_connections_operations.py index cf121c9addbca..28e4a4119954b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_gateways_operations.py index dc687b4d16006..19673a098093c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_configuration_operations.py index b0d383b24e877..edbbb3c66e21a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_operations.py index 507dd67917f71..c91484e46b20d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_metadata.json index 8ace2e1622399..7dc31923d542c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -130,7 +131,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_12_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -142,7 +143,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_network_management_client.py index 6f2334c45e6c8..ffc9e3e682435 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/_network_management_client.py @@ -258,7 +258,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/_network_management_client.py index 5a20d89e860fc..58849b81693ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/_network_management_client.py @@ -255,7 +255,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_gateways_operations.py index 5d172e9afe467..261f1b40a7325 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -934,7 +970,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -985,7 +1021,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1036,7 +1072,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1050,7 +1086,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1058,7 +1094,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1100,7 +1136,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1108,7 +1144,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1150,7 +1186,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1158,7 +1194,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1253,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1227,7 +1263,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_security_groups_operations.py index 627594abaf0e7..83425cd1cd2f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_delegations_operations.py index d8e16a6567446..d96978ae6fded 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_endpoint_services_operations.py index 2bef26c9378da..86e721be5d1d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_resource_group_delegations_operations.py index 66956dc1fa31e..0b06b001af32c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index db33f916a58cb..58af3320aaadb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewalls_operations.py index 8b3f591116764..56e99039e7e9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_bgp_service_communities_operations.py index e8352756a3c96..1fbb7c109f977 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_connection_monitors_operations.py index 4e8b65b10540e..f43535cb904ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_custom_policies_operations.py index 0cd7a763d0bdd..bd6ed15ceb609 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_protection_plans_operations.py index 8f606d84091c1..fc44bb5b83deb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_default_security_rules_operations.py index 0100685d42b12..e45680d2f8f80 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_authorizations_operations.py index ffc7562707bea..c29ca36dfa29d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_connections_operations.py index f98d207e360f2..e0155e548526a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_peerings_operations.py index 1edcf16595f0c..717d8707b6460 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuits_operations.py index a42c93be8ce05..bc9e901dc7957 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_connections_operations.py index 7104e42355439..57a15a37d5061 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 573dee9a50d96..75c0126d77eb4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connections_operations.py index 9c8d492ea57cb..f311ae30ddd0e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_gateways_operations.py index 719faad303396..c7016afc9499b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_links_operations.py index 67cbdfd26bb9d..c4d5c4997087f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_locations_operations.py index a90430c6fb48c..9f251514fd588 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_operations.py index 6924c1a63ace6..d4384683de0fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_service_providers_operations.py index 6c58c0dfb729a..0c2a53b2ec849 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_hub_virtual_network_connections_operations.py index 7305238d5b4e3..d1763e8c9146b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_inbound_nat_rules_operations.py index 9990c56c3e728..e1bbc0cb27e90 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_interface_endpoints_operations.py index 47294a60edee6..5337d6927f90f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InterfaceEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( interface_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InterfaceEndpoint": + ) -> "_models.InterfaceEndpoint": """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> "models.InterfaceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + ) -> "_models.InterfaceEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> AsyncLROPoller["models.InterfaceEndpoint"]: + ) -> AsyncLROPoller["_models.InterfaceEndpoint"]: """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 86aac43bde418..e9e1f93c43271 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 01233663a53b1..e7057918b4cda 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 1d92f2627e8f8..1e9290c7a8935 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_network_interfaces_operations.py index 22e71fa91b5c2..c752d8dab6dae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_outbound_rules_operations.py index 734e00b9b8fda..606422250693a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_probes_operations.py index c335b4b184cee..a156a10c72bbe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancers_operations.py index b8c5a67e04177..6238b84199998 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_local_network_gateways_operations.py index 61d1994bb5bfc..4c9c914024f54 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_ip_configurations_operations.py index 4d91193fd45e4..40615e80a0cfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_load_balancers_operations.py index 0f785979e6816..129fcbaef5e4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_tap_configurations_operations.py index 94d2224526421..8b6536e54b1b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interfaces_operations.py index 6c8f33d6a2016..2fad133d6b52c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_management_client_operations.py index bc77273f4f767..2997c97f5da94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_12_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_profiles_operations.py index dfce61d739496..2c974b328d65c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_security_groups_operations.py index 3f04b37f8d47f..0c075c2a1bdb9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_watchers_operations.py index 7206183935be5..4343a4085985e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2018_12_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_operations.py index 6922a5d3561ca..314c169a87367 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_gateways_operations.py index ce3c4c844678c..dd77ff568859a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_server_configurations_operations.py index 79ee3a12f360d..f65a8a822f341 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_packet_captures_operations.py index e081fc657461c..37862c6068c60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py index 8baa46e5e0704..9ab5936e0ff3a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_addresses_operations.py index 147cdd9fa9a0e..41777616ff151 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_prefixes_operations.py index 5e6373729cb7d..39dcab9ce6fe9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filter_rules_operations.py index 1c1179d7a1923..590609b88c45e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filters_operations.py index 48f23f49c6ce9..7189cbd45e301 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_tables_operations.py index 5b90c4b54e9b2..b16bf925c0c75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_routes_operations.py index 24501c728cce6..13ed5fa917189 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_security_rules_operations.py index 869e6b1056574..c726487c27196 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policies_operations.py index 22adba0953dbe..76ae33d52ad3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py index a9cb47027cea1..74859ce6bcebc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_subnets_operations.py index cf787d9d0eb75..6d657a8cef6f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -399,7 +413,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -447,7 +461,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -466,7 +487,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_usages_operations.py index 39019484d8c62..843a850fefaae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_hubs_operations.py index 979a4e3106a91..31e11a711d7c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateway_connections_operations.py index 28866dd6519b6..ea0b625a0792a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateways_operations.py index 79dd4ab4a1522..1fcc1287fd39c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_peerings_operations.py index 7dc6c7838c007..0838568d98adb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_taps_operations.py index b6c9540790422..ec847434a7f5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_networks_operations.py index ef422dc2bced1..a5a627539c0db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_12_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_wans_operations.py index b3c445ddb3f0f..a2241078e1088 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_connections_operations.py index 20edac88621ab..aaa89c9704bb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_gateways_operations.py index b836e61d88ef8..a3907f309839c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py index fcc1639e4d909..114eb87a0c570 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_operations.py index e4eb58f7ce09d..354fc0bf17ef7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_web_application_firewall_policies_operations.py index eca354bebfb24..4abefeea4e28e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_gateways_operations.py index d45a4db421e24..0e22b03deb044 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -954,7 +990,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1006,7 +1042,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1058,7 +1094,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1073,7 +1109,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1081,7 +1117,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1124,7 +1160,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1132,7 +1168,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1175,7 +1211,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1183,7 +1219,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1243,7 +1279,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1253,7 +1289,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_security_groups_operations.py index c01548eb6079f..968d99b1b46ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_delegations_operations.py index 35cb51c3a01ee..e100fb5d0580b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_endpoint_services_operations.py index 97402b2181912..b4509553d2d0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_resource_group_delegations_operations.py index 2220afd3113f9..569c48ba06a0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewall_fqdn_tags_operations.py index 5ad738cbe4c97..52db1d94b1fc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewalls_operations.py index 24c12ccc5f48d..56356cb847000 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_bgp_service_communities_operations.py index ab48217b9beb6..eb8774a7dd54b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_connection_monitors_operations.py index 22ce197b30acd..d5de040b5062c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_custom_policies_operations.py index a58e0929f1beb..a6a1c4a0aad90 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_protection_plans_operations.py index 28cd2cd50c42f..fb1c4684db347 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_default_security_rules_operations.py index 7e0914fceb9f0..66980176d9f17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_authorizations_operations.py index 198bf28015a83..3eb30b737c8c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_connections_operations.py index 7d45000279521..d271a89b222e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_peerings_operations.py index 2fc7b0e2b22b1..c3f0a359728fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuits_operations.py index 15ac82232dee3..aecd076343a1f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_connections_operations.py index cc054eaed965f..85efafbf0ef5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connection_peerings_operations.py index 007502ad1bdbf..81f9fd191cfd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connections_operations.py index be3f616c95d63..60544a244871c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_gateways_operations.py index 1f3e16cd717d8..99fb3555eff6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_links_operations.py index 9afdc37e9de8d..a37ba478f8de5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_locations_operations.py index 85f22b3b17028..48655c00db766 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_operations.py index fb072b5aadd18..2ae698ff8c104 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_service_providers_operations.py index 2b8e02dfa2fa8..d8aff55985af6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_hub_virtual_network_connections_operations.py index 43e1a9a09e75b..e45b61ce38980 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_inbound_nat_rules_operations.py index 5f279c5c6bb51..607b18d309af7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_interface_endpoints_operations.py index b30d71c7de48e..8d8172409aefa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InterfaceEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" + # type: (...) -> "_models.InterfaceEndpoint" """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + # type: (...) -> "_models.InterfaceEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InterfaceEndpoint"] + # type: (...) -> LROPoller["_models.InterfaceEndpoint"] """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_backend_address_pools_operations.py index 3816dd2aed4a4..e232dbdfb5a33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py index c829744158d4a..5801d4ed386b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_load_balancing_rules_operations.py index a4294544836d8..72af9ee120118 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_network_interfaces_operations.py index 08ab0447266b6..cf87b54603472 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_outbound_rules_operations.py index 033fe44a3f137..763cc6c48b12a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_probes_operations.py index 2afbedba81df5..5cb6078049c75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancers_operations.py index f11a4217a67b2..8c7abcb6e498e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_local_network_gateways_operations.py index 9cc340144c007..b7b5531df29aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_ip_configurations_operations.py index b61b9c1148218..0a43659466250 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_load_balancers_operations.py index db53da39ac54d..4ccc03f29f50a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_tap_configurations_operations.py index b79e33feedc73..a95a9a8aabd88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interfaces_operations.py index edd4a578a0de3..6f6211e0a2a35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_management_client_operations.py index 224efbb9f477f..8c9a078a8bd8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2018_12_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_profiles_operations.py index 90b63f37adb59..7db5332ef4e76 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_security_groups_operations.py index 038145f55ce63..7d4b432dba0b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_watchers_operations.py index 4765fa29067a1..9dbb3572443fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2018_12_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_operations.py index afa7ab6c35e1a..9e4ed5e683d57 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_gateways_operations.py index 3345a85c110f4..6704889038706 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_server_configurations_operations.py index b0f2f2b66f8d4..3f33586bc194f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_packet_captures_operations.py index 146e3898949fd..682f9acc936ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_peer_express_route_circuit_connections_operations.py index f32a36e87a92c..778410e9071f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_addresses_operations.py index 2ca51401d3762..53df6e44f259e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_prefixes_operations.py index 07d88cf3c6cd5..65b5b9189e6f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filter_rules_operations.py index b3dbcf53be8aa..9a2c64a109a60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filters_operations.py index 3c7b55c8e61ae..a398f6033cd20 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_tables_operations.py index 3b5455b9b78d8..8fd156096e08d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_routes_operations.py index f3cf876dcb227..f1a656e66b01c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_security_rules_operations.py index 04c2302a2b46a..23dfc9d1a0c90 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policies_operations.py index 78dece22f87b7..fad23d784eb4b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policy_definitions_operations.py index 2b3dffe6c33f5..4f451ffb2bbf8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_subnets_operations.py index 2a70dbfb71934..9ecc1c55ff09f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,7 +372,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -409,7 +423,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -478,7 +499,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_usages_operations.py index 766c582064bf0..dbba9983066a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_hubs_operations.py index 2ea108a6c0609..8acadd8944df5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateway_connections_operations.py index 6a1173989fa0f..dbb8ceb2e9c4b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py index c2b0301a9bb17..44ef6f66741b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_peerings_operations.py index 7432b91a72f79..4ba69afc5e35a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_taps_operations.py index d358dbbdcac83..3a52f91a1b88e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_networks_operations.py index 436fb8f4c4289..6777b73463c42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2018_12_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_wans_operations.py index e8d356334ce9f..59e8cfae7655d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_connections_operations.py index 8f9ebdfd5eb39..893889c236dd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_gateways_operations.py index ed6589a9f05d7..612d09e312f51 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_configuration_operations.py index 276992d9199be..a5aaba569a577 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_operations.py index f4bc152ba8654..95837a7a54eb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_web_application_firewall_policies_operations.py index 5a5230a428f05..5e7853faab627 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2018_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_metadata.json index edd1851dfb0bd..3c37cdb2c54ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -133,7 +134,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_02_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -145,7 +146,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_network_management_client.py index 6e051f058a13d..8d576738ef49f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/_network_management_client.py @@ -267,7 +267,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/_network_management_client.py index 858a40503f0bb..655eb2f467707 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/_network_management_client.py @@ -264,7 +264,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_gateways_operations.py index 940de7ff84564..98b264ddb8137 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -898,11 +934,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -956,10 +992,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -982,7 +1018,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1008,7 +1044,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1062,7 +1104,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1113,7 +1155,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1164,7 +1206,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1178,7 +1220,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1186,7 +1228,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1228,7 +1270,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1236,7 +1278,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1278,7 +1320,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1286,7 +1328,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1345,7 +1387,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1355,7 +1397,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_security_groups_operations.py index 539bd2dfd76b1..cc98d6aebca77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_delegations_operations.py index 7cec3705f59e7..c6dca5758e72d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_endpoint_services_operations.py index 9dd9e1eba3dad..9572d4d40f6d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_resource_group_delegations_operations.py index 94351417cda9b..f930aa3c2f6f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 4b38afb07beea..31c15938cc286 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewalls_operations.py index 4f279a5ce2daf..060add2c53358 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_bgp_service_communities_operations.py index 5d18fde2b77df..d9fa9f6040cea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_connection_monitors_operations.py index 4ae7fc87a8fd7..12c22a6932c72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_custom_policies_operations.py index 63df2c2f888ea..0ef21623c67ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_protection_plans_operations.py index 07d00deef47e5..bcde4407591cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_default_security_rules_operations.py index 20b2f899986a4..8da0e027f86c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py index 8c7f0b7084205..e08e9f27a1570 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_connections_operations.py index d7a83293be907..08c0b74b62215 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_peerings_operations.py index 437fae4403589..b6cc18c510b9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuits_operations.py index 12eb395abf8ab..35b47054f0931 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_connections_operations.py index 0f683d62ab83f..a50ad9df1159a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 88eed14c65b55..ad1e20591fdec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connections_operations.py index dfc1faccdaf79..f1252c04a5f8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_gateways_operations.py index db2f8881ab56d..4e7899ba52772 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_links_operations.py index b75526a9c02b3..d24203e75b65c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_locations_operations.py index bbaccf0e63ae3..4ff75cd13571a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_operations.py index b2645ac678634..f185c5fa710e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_service_providers_operations.py index 500bc9fa2274b..7fe4e590e0fd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_hub_virtual_network_connections_operations.py index 0e157e504cbb8..6121195aae583 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_inbound_nat_rules_operations.py index edc5c0128d3c6..af018218753f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_interface_endpoints_operations.py index 57f184ed54677..c40051f7af192 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InterfaceEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( interface_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InterfaceEndpoint": + ) -> "_models.InterfaceEndpoint": """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> "models.InterfaceEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + ) -> "_models.InterfaceEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, interface_endpoint_name: str, - parameters: "models.InterfaceEndpoint", + parameters: "_models.InterfaceEndpoint", **kwargs - ) -> AsyncLROPoller["models.InterfaceEndpoint"]: + ) -> AsyncLROPoller["_models.InterfaceEndpoint"]: """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,7 +344,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -342,7 +354,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.InterfaceEndpointListResult"]: + ) -> AsyncIterable["_models.InterfaceEndpointListResult"]: """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -409,7 +421,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 089d273232a64..2f3e5612ecfc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 5d34151753fc1..2cf1504b03e6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index a16f4afdb1d64..f1e79ff3d21bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_network_interfaces_operations.py index db01c1c29a6fe..8d9eb0e327135 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_outbound_rules_operations.py index 691a147f2ce9a..5b2b1ab627687 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_probes_operations.py index 725fb37b00160..a4fd280067fb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancers_operations.py index c0710fb4d3e47..452318e924263 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_local_network_gateways_operations.py index 5c0910f7e7d4e..fe83886c0907e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_nat_gateways_operations.py index f2774d91545a2..73c41825d00df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,9 +276,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_ip_configurations_operations.py index c033b3dd0c2a9..ad33c1f7176de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_load_balancers_operations.py index ef457c7a19f0a..23619778024ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_tap_configurations_operations.py index 8e462fcabc4ef..83ddc27a296a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interfaces_operations.py index 17d52b1ecfa20..4e2e8d367ac62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_management_client_operations.py index a91a24bcd2c68..44841c25caeed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_02_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_profiles_operations.py index 55163f91bb584..b7bf27516d1ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_security_groups_operations.py index 01f909d64faa1..c32634cac9dd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_watchers_operations.py index b1db656435c71..b261b5ce4406a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_02_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_operations.py index c91e224dfe017..7076abe5972af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_gateways_operations.py index 458177f9d33e0..9dcd7fb7b8526 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_server_configurations_operations.py index a3c23d37e1035..4a6e388c7eccb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_packet_captures_operations.py index 22b325191885e..9c45263dac35e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_peer_express_route_circuit_connections_operations.py index 348b93529b94b..8818f02965fd6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_addresses_operations.py index 18071504709af..abee96f0dde4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_prefixes_operations.py index 9bba5c47b9a13..1e9fd73077699 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_resource_navigation_links_operations.py index 5c825331a9237..0896cad457e92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def get( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filter_rules_operations.py index a29e6c8082e0e..19b4b2001f40c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filters_operations.py index 658d296400775..0dd6c6f8057f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_tables_operations.py index 0cb56563d6938..80f8ee4009a2d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_routes_operations.py index c33642d1c930b..eb6cbcc5fb00f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_security_rules_operations.py index 4c50dc3a583cc..49885e110dc0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_association_links_operations.py index 1f841b41f5d84..9452e4ef9a90a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def get( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policies_operations.py index 7e77d49e0af45..1dc7f1236f7a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policy_definitions_operations.py index f00a6d3980f1a..1e3c368f5501c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_subnets_operations.py index e1478506de9a4..184e525f71977 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -399,7 +413,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -447,7 +461,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -466,7 +487,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_usages_operations.py index 767edb83eb182..797fea8be525b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_hubs_operations.py index 2f17bc08b33a7..db5b3ecdcf204 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateway_connections_operations.py index 4cdcef979c173..cff9441d1eaf5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateways_operations.py index 1a2a64d7eebfd..2c65dc0379ab4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_peerings_operations.py index cca6adb1bfaac..f86c326a402c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_taps_operations.py index aa1946f0d0f98..e4a570aeec356 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_networks_operations.py index d034169113bcf..d1b0025279a21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_02_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_wans_operations.py index 6bfbd4de3acd6..7e3f6c74320eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_connections_operations.py index e73d38ab93133..7b3eb2adb5ffd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_gateways_operations.py index e7d0645f5aba5..4ac3f29c085ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -466,7 +484,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -579,7 +597,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_configuration_operations.py index a1a25c1929abd..9b69483bc56ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_operations.py index be8e5a551cdbc..5d63c609867fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_web_application_firewall_policies_operations.py index 9ae45ba1e2649..73c717d0cbacb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_gateways_operations.py index 2ea209b0b21f5..bd2e5e20d96d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,12 +953,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -976,11 +1012,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -1003,7 +1039,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1029,7 +1065,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1084,7 +1126,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1136,7 +1178,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1188,7 +1230,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1203,7 +1245,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1211,7 +1253,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1296,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1262,7 +1304,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1305,7 +1347,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1313,7 +1355,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1373,7 +1415,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1383,7 +1425,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_security_groups_operations.py index 1d0e660f21110..204ac1ccd96b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_delegations_operations.py index b9fad1dda57a9..15f159ada688f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_endpoint_services_operations.py index 79aacadf4f6f2..8634cac336f49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_resource_group_delegations_operations.py index f477c6c0f60ac..c9dcc3e71044c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py index 2550b42e2fe7a..1c3e55d605c62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewalls_operations.py index 01492819d5607..2ed22dd7d5512 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_bgp_service_communities_operations.py index 84e445d206b4b..01bcc962e3f68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_connection_monitors_operations.py index 073e0a962c13c..3e92ab08dcae1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_custom_policies_operations.py index bc32a2085dd56..b41d93d6583c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py index f2aa13c14d817..a17c442e63d0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_default_security_rules_operations.py index 1401706522b52..a6c02dd6d0fbb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_authorizations_operations.py index e0eb367a99cee..0d05eee1a46e5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_connections_operations.py index aaf312f1562b9..471ce848e5771 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_peerings_operations.py index db6f4b5a04da8..51f496c1443e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuits_operations.py index f60e22150247d..2dd3f4a56ec0e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_connections_operations.py index f61af36fc4191..1b36796a778b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connection_peerings_operations.py index 8b3f940ac6093..73780f8f334ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connections_operations.py index 81b0551b41ad3..c2bb65a850227 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_gateways_operations.py index 08582600dba28..1d9a9fc9cdd50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_links_operations.py index 8481f5eae7a81..0caa69190bdd2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_locations_operations.py index 81f6aecf48e3f..17e3774f7e421 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_operations.py index 921ffd614bd75..8832c8140539d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_service_providers_operations.py index 6ff396066abab..f90194f2113b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_hub_virtual_network_connections_operations.py index 07f15580956b9..1b736868f1e07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_inbound_nat_rules_operations.py index b9c42af0acb37..f3440e864cabd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_interface_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_interface_endpoints_operations.py index f860bdfbf8b56..2d69007ae42d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_interface_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_interface_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InterfaceEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" + # type: (...) -> "_models.InterfaceEndpoint" """Gets the specified interface endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.InterfaceEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.InterfaceEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + # type: (...) -> "_models.InterfaceEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str interface_endpoint_name, # type: str - parameters, # type: "models.InterfaceEndpoint" + parameters, # type: "_models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InterfaceEndpoint"] + # type: (...) -> LROPoller["_models.InterfaceEndpoint"] """Creates or updates an interface endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,7 +354,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.InterfaceEndpointListResult"] + # type: (...) -> Iterable["_models.InterfaceEndpointListResult"] """Gets all interface endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -420,7 +432,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.InterfaceEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InterfaceEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_backend_address_pools_operations.py index 949092154d387..3b6908dacd680 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py index cbd73e934477c..3de9b1da1b691 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_load_balancing_rules_operations.py index 96688248d4171..368f7ccf39601 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_network_interfaces_operations.py index ff9e74628e430..9b38864009581 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_outbound_rules_operations.py index 945a004985761..b3216f6ac6d38 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_probes_operations.py index f2a4153f4b5f1..71ea0cf1a0b4b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancers_operations.py index 3f016a9e4e8d6..61c814c4c4b0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_local_network_gateways_operations.py index 4c7b9e3f6fa4d..d61dbdf9980fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_nat_gateways_operations.py index 1454911050f64..23765368c8934 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_ip_configurations_operations.py index 4e2dd471d4e5f..e63c4167c295c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_load_balancers_operations.py index 0a2dbd712272a..45f8deb9314bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_tap_configurations_operations.py index 40503e323d264..7cbc26a5df938 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interfaces_operations.py index b09c6b2d6347d..38e42cf210012 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_management_client_operations.py index 81a918e0fb740..45814baa1b451 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_02_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_profiles_operations.py index d492dd93de9bc..6f81af1e153a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_security_groups_operations.py index 14f5411da30cd..583923c6e8b2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_watchers_operations.py index 76c9463d3255f..1819ccd6131f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_02_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_operations.py index 8b46f246d13a3..3967987dfa573 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_gateways_operations.py index 2dd84d70b93e9..9047d92724ab2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_server_configurations_operations.py index 12cebb7dbb9e1..cc0589128faf3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_packet_captures_operations.py index ff6e7f8f35fa2..5e8a04c342820 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_peer_express_route_circuit_connections_operations.py index 13967fcbde6c6..7bd8282353899 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_addresses_operations.py index 0aa9f5a1e18ee..5c573a430dd06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_prefixes_operations.py index 91da72fea10c0..da14453b8c11b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_resource_navigation_links_operations.py index 2f3ac8f590345..a9104d56e8f52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def get( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filter_rules_operations.py index 75c9f78afa68f..e3e798c6e08d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filters_operations.py index 6000e369995f6..579fbf33e6309 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_tables_operations.py index 8da04d827bd0c..9dadcbfc2e9b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_routes_operations.py index 003c3d1df4a7a..bbecf76ec75d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_security_rules_operations.py index 831fa9cd6dee0..52d1e1a480ee5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_association_links_operations.py index 7131c0523d390..fde4a7075fe6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def get( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policies_operations.py index d9735e57bb3ed..a4283a1893704 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policy_definitions_operations.py index faec368e6b1e8..7e2d86b04b2ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_subnets_operations.py index 6a9a6417ca303..5edab7363c288 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,7 +372,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -409,7 +423,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -478,7 +499,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_usages_operations.py index 47af75304182d..e5436080a5b38 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_hubs_operations.py index bdc8deb878588..72f807b51a407 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateway_connections_operations.py index 5a5bc6452dab5..a2d814f957a75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateways_operations.py index 9a83aff95a6e2..3e16bbd8a57d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_peerings_operations.py index 98dd23e4415da..09e3465dad184 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_taps_operations.py index 53a601218072c..4eb88737e0363 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_networks_operations.py index 861b13c9ade41..0aea77a7df1ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_02_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_wans_operations.py index d18eed4e5081e..2b21b4e8c60b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_connections_operations.py index 1d10ce6a1d0bc..14cac03c4a118 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_gateways_operations.py index aa607a9767f4c..f19e00643fcec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -468,7 +486,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -478,7 +496,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +610,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_configuration_operations.py index 1beaf6a8c6433..02c6ea0cc8c13 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_operations.py index 50f29d08f7696..0dcfeb409207a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_web_application_firewall_policies_operations.py index c0005dafaf2ea..8fca4dd378f8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_02_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_metadata.json index 2ded48e9dee21..c39147ce582a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -137,7 +138,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_04_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -149,7 +150,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_network_management_client.py index 912d3689a3e0a..30951784fa5ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/_network_management_client.py @@ -279,7 +279,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/_network_management_client.py index a15320e113c5d..582e9fd6fe967 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/_network_management_client.py @@ -276,7 +276,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_gateways_operations.py index 47f24b871b6b4..2b2985ed78bed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -898,11 +934,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -956,10 +992,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -982,7 +1018,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1008,7 +1044,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1062,7 +1104,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1113,7 +1155,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1164,7 +1206,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1178,7 +1220,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1186,7 +1228,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1228,7 +1270,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1236,7 +1278,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1278,7 +1320,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1286,7 +1328,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1345,7 +1387,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1355,7 +1397,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_security_groups_operations.py index 84e7cc5791675..4f465fa7de1a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_delegations_operations.py index 9775ef2a64900..b48fbc48f0576 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_endpoint_services_operations.py index 1210aba40840c..8b6f57d47c220 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_private_endpoint_types_operations.py index 5664d43213c6a..16c3e5938ca87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_resource_group_delegations_operations.py index 13fe964dcbcef..a342817984cf3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 769a1652c08d1..2f9a93d67f388 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewalls_operations.py index eb9ebf6466067..a52aa97da47a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +339,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +416,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bastion_hosts_operations.py index e1cb1c7a3a2f0..9c5cb4566b4a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bgp_service_communities_operations.py index 56149c13e81d5..5fac79ad1db73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_connection_monitors_operations.py index 19c7d2eb793ee..f167d667c27cb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -383,7 +397,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +453,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -492,7 +513,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -548,7 +569,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -568,8 +596,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +629,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -622,7 +650,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -642,7 +670,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -667,7 +695,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,7 +721,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -698,7 +733,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +780,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_custom_policies_operations.py index eac7c4ae02f97..41408beede530 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_protection_plans_operations.py index 6384ceee225c1..6a247c2befdfb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_default_security_rules_operations.py index 226104461026c..3725186950b0e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_authorizations_operations.py index e0229de17adf4..ea56205863735 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_connections_operations.py index de82156be726b..354ed698ed4d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_peerings_operations.py index 4a5f7931bfa80..e5a7fb89b94a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuits_operations.py index 6bf9d4b721a9e..c781ece874840 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_connections_operations.py index 4c1b061d5d110..7b9dc0bcc4f9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 5f4b951e2af61..887c52d47223f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connections_operations.py index b642b80964b41..43efc73b73f88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_gateways_operations.py index 495729a3c7ec9..06ed4c967f33a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_links_operations.py index be2341ccb15d0..56cbb33dabea0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_locations_operations.py index 4bbc056b55fd5..45e96838e9b83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_operations.py index d1a972e244858..2bc21477d7e48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_service_providers_operations.py index 0a2bc8e382434..8121b9391015d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_hub_virtual_network_connections_operations.py index 3c2f5b55dfe0e..e5525b14b4022 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_inbound_nat_rules_operations.py index ddca0ae366ee6..2668c1b584347 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 48620ce6ff6ab..f200ffd1e04e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 13a3cdfd12cfc..07a6b1c1a4518 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 26309ccf02688..01a6c664cced1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_network_interfaces_operations.py index 73a8772c0417b..1ec299de42b66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_outbound_rules_operations.py index a20687166bc4d..82cf029e129ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_probes_operations.py index 59944e7c90106..174d2f2e71869 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancers_operations.py index f45d6d663e257..b31c4cf029616 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_local_network_gateways_operations.py index b1633c9c66480..ec726e6239b83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_nat_gateways_operations.py index 1f80966e72202..434dc8677dfb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,9 +276,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_ip_configurations_operations.py index 08dded51b2562..05a6e2e2f3370 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_load_balancers_operations.py index 356ab4548a2bf..019fa53bc0749 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_tap_configurations_operations.py index 120706cfb222b..1206a5ca5d70e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interfaces_operations.py index 42e1d59697b30..4e3eba2f46c51 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_management_client_operations.py index 2bbe7ebda5c05..5c485b8a93e0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_04_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_profiles_operations.py index bb0e8b72ee2f6..339c73c1b12ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_security_groups_operations.py index c9023b0a5db90..e8e4a61685870 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py index 2a7be6359ab11..07eee50e98b6a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_04_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_operations.py index 5b402a4442df3..7817439a68400 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_gateways_operations.py index 39af3fa11e88b..230f2d53749a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,8 +741,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +790,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -785,7 +809,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -809,7 +833,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_server_configurations_operations.py index 0a1d084a3718d..ff70e60175f6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_packet_captures_operations.py index 9d10b5c4e55ba..8aa18b6247fff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py index de64feb5658d2..fb58872cc4ce4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_endpoints_operations.py index 2f469b194c67c..c4d1583126720 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_link_services_operations.py index 1ed47f8330a01..a632842a7d47e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -476,9 +488,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -494,7 +506,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -581,7 +593,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -637,7 +649,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -654,10 +673,10 @@ def get_long_running_output(pipeline_response): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -707,9 +726,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -727,7 +746,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -751,7 +770,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -769,10 +793,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,9 +848,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -846,7 +870,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -871,7 +895,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -889,7 +919,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -900,7 +930,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -961,7 +991,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -974,7 +1004,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_addresses_operations.py index 451e31265be2b..bbf1d860fd609 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_prefixes_operations.py index 390350f579291..51da2f098d86f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_resource_navigation_links_operations.py index fbda9d156257d..75399d5612e85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filter_rules_operations.py index d6a2fa0e3b7ea..8f1d54e381d5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filters_operations.py index 233d91dbd2db7..ac917da53b5ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_tables_operations.py index b34fdfbd4a8c4..7f7f9561a5c1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_routes_operations.py index 53360a23d2f5a..d5aa45eebd84f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_security_rules_operations.py index 8e236f7f35ce6..b5aa13202153f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_association_links_operations.py index 8ead967ceade3..c19614298f62d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policies_operations.py index 9dc5683e4b4b5..856a4fe584e39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 3dd407b5b18a2..faf0e57276788 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_tags_operations.py index 348aad057e8e0..1fef7483c8361 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_subnets_operations.py index cafdb036ad7f4..a688f6352adf6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -399,7 +413,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -447,7 +461,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -466,7 +487,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_usages_operations.py index ca9320da5192b..b831893764a94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_hubs_operations.py index e54959f41f074..930c98236516b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateway_connections_operations.py index 365be312d3be7..8069c4b593ca6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,10 +468,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,9 +525,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -532,7 +550,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -590,7 +614,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,7 +659,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -646,7 +670,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -706,10 +730,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,9 +785,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -787,7 +811,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -812,7 +836,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateways_operations.py index f1e778b2733d4..5216a20bb7186 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -528,7 +546,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,8 +609,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -643,7 +661,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -664,7 +682,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -689,7 +707,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -790,7 +814,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -863,7 +893,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -912,7 +942,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -930,7 +966,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -985,7 +1021,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1034,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1165,8 +1213,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1217,7 +1265,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1237,7 +1285,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1262,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1339,8 +1393,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,7 +1442,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1407,7 +1461,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1431,7 +1485,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1451,8 +1511,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,7 +1562,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1523,7 +1583,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1608,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1566,10 +1632,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1621,9 +1687,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1645,7 +1711,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1670,7 +1736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1689,8 +1761,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1736,7 +1808,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1756,7 +1828,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,7 +1852,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1798,7 +1876,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1866,8 +1944,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1915,7 +1993,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -1934,7 +2012,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1958,7 +2036,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_peerings_operations.py index af09df46aaccb..d80b9152fdc33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_taps_operations.py index 6dafcd8ea4546..b2a8d78a7996a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_networks_operations.py index 7e8f86cd2565c..7386a684faf60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_04_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_wans_operations.py index f244998446daa..d1941f2048caa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_connections_operations.py index 1e04fa20823c4..e3df87e86837b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_gateways_operations.py index 2986a098a3560..37d914606ae32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,8 +475,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +524,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -524,7 +542,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -548,7 +566,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -566,7 +590,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -576,7 +600,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -622,7 +646,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -636,7 +660,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -644,7 +668,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,7 +713,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_configuration_operations.py index 2fcf85dd2240d..5709bbbd04f18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_operations.py index 424c916dee6a6..f8047dfc43f3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_web_application_firewall_policies_operations.py index 11a063a29a117..9dc01ea8ece19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_gateways_operations.py index 4af4caaee7c47..7e286a96ffe20 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,12 +953,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -976,11 +1012,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -1003,7 +1039,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1029,7 +1065,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1084,7 +1126,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1136,7 +1178,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1188,7 +1230,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1203,7 +1245,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1211,7 +1253,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1296,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1262,7 +1304,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1305,7 +1347,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1313,7 +1355,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1373,7 +1415,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1383,7 +1425,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_security_groups_operations.py index 77fded92a203f..da6ce920ef240 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_delegations_operations.py index ffc5c3a9f80dc..a28723fd96e77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_endpoint_services_operations.py index 395f1896c22c2..e5752af571641 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_private_endpoint_types_operations.py index 6d2f74c9b7d0a..5aa55f9fceb55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_resource_group_delegations_operations.py index 0b2a63b4cbb06..8c8119a686e2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewall_fqdn_tags_operations.py index 35aac489cb201..1625af88d90c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewalls_operations.py index ffdf56d7ff92b..8a36b74dc217b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bastion_hosts_operations.py index 9a28248267d39..87533f4d42c01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bgp_service_communities_operations.py index 51c80dab330f4..a9634f20e510a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_connection_monitors_operations.py index cc8863889cf30..dd645901e0979 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -393,7 +407,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +464,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -504,7 +525,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +582,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -582,8 +610,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +643,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -637,7 +665,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -657,7 +685,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +710,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -702,7 +737,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -714,7 +749,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_custom_policies_operations.py index a02b14725a81f..df01b00110a36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_protection_plans_operations.py index 809339e25c0c0..d971927ea9d9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_default_security_rules_operations.py index 1845d2fdfbb4b..fadc5776acbf5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_authorizations_operations.py index ecccb33d4f35d..89c6a571f8810 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_connections_operations.py index fa28d36371e40..0084c8bfd11f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_peerings_operations.py index 26bc1b90f0359..f297dc8e5b2fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuits_operations.py index d859053593700..ff120c76376dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_connections_operations.py index 80b64ede72e89..ee663771e7d7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connection_peerings_operations.py index 4d90b4d1373c7..2c00c3fb602fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connections_operations.py index 2adea2655fb25..9ddd2d2214aea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_gateways_operations.py index df879b5fd0229..69a8b2b4030e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_links_operations.py index f5ba00e3acc4a..4f5e9f7c269dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_locations_operations.py index a42512aa6b8dd..8360cd13ab1cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_operations.py index a2e6885ecdf38..d13fc8babeaa3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_service_providers_operations.py index 412b459e07fdb..6471b058bd034 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py index 27efa7a78feb6..be55d44f64ed1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_inbound_nat_rules_operations.py index 8fc7564f79fdf..111dcb904f640 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_backend_address_pools_operations.py index 3fa27bdc8fcec..4e74abdc989fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 60d1d2a6a9cbf..096e39eff42d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_load_balancing_rules_operations.py index 2a5e605b9efaa..62ce3367cb4a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_network_interfaces_operations.py index 79ae17869d0a3..5c77de5176a7f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_outbound_rules_operations.py index 7971d6fec3dc9..0fa0761679095 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_probes_operations.py index c98c0c55015f4..ed8a3861d9948 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancers_operations.py index 5dd664bc6382b..c227b5b124055 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_local_network_gateways_operations.py index 13e17854616d7..5d63be646c908 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_nat_gateways_operations.py index e16b2e11d7162..5583c644590bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_ip_configurations_operations.py index 170e5f34d6914..9096c4803ba80 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_load_balancers_operations.py index 3c688f3c307b0..9d93be79defe2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_tap_configurations_operations.py index 40531f6ecc050..c70de631e136a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interfaces_operations.py index 17fee4a2e5993..4e674790f1d2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_management_client_operations.py index 805db292748f4..5fc7b4a0413c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_04_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_profiles_operations.py index 8071398fa72ee..f30ba48f49928 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_security_groups_operations.py index 144f732d205f5..6a6b022311b1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_watchers_operations.py index f66ffe28a61a1..a8800ee4412fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_04_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_operations.py index 85efbbff3c362..ee31474b29094 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_gateways_operations.py index 8777b3e0a7ce4..692695f70df8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,8 +757,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -783,7 +807,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -802,7 +826,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -826,7 +850,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_server_configurations_operations.py index 314cc74551da0..7d13216662ee5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_packet_captures_operations.py index 10f843837a27b..dd43506d21509 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_peer_express_route_circuit_connections_operations.py index 25337165f9ce0..52f6a7f9d2428 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_endpoints_operations.py index 86dd71fd69405..f894417720151 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_link_services_operations.py index 78d3132c1cc02..20dfb180b876e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,10 +499,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -506,7 +518,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +555,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -594,7 +606,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -651,7 +663,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -668,11 +687,11 @@ def get_long_running_output(pipeline_response): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,10 +741,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -743,7 +762,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -767,7 +786,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -785,11 +809,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -841,10 +865,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -864,7 +888,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -889,7 +913,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -908,7 +938,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -919,7 +949,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -981,7 +1011,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -994,7 +1024,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_addresses_operations.py index c739644ccaae7..eac4b6c8585c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_prefixes_operations.py index 23515df152c41..8563df62f4106 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_resource_navigation_links_operations.py index 01e911763269c..5cb80a69ed61e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filter_rules_operations.py index 5beca9f742ab8..c1e52d3cf944b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filters_operations.py index 967baafaf78ad..86500bba3b1c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_tables_operations.py index 2bca8c80c9d08..492118bfd6d00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_routes_operations.py index c545adea36fd3..da4c9b94e6644 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_security_rules_operations.py index 46e09db37d0ac..eb92e97e8ea34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_association_links_operations.py index 203bc13322ac0..79003c9e0a4b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policies_operations.py index eb724eb4316c2..198993e831aec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policy_definitions_operations.py index 4f81e69577bfd..f385e70ee49ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_tags_operations.py index 15b1ca72e6eb0..69b52c0dd9d73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_subnets_operations.py index 05916507ee323..2940b4863092d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,7 +372,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -409,7 +423,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -478,7 +499,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_usages_operations.py index f6bc93dfbc26a..632d617730a7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_hubs_operations.py index 0d94083545ef0..27f1e9d50966d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateway_connections_operations.py index c4e10d8bdd0f5..a7c42f0a8048a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,11 +479,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,10 +537,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -545,7 +563,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -570,7 +588,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -590,7 +614,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -604,7 +628,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,7 +674,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -661,7 +685,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,11 +745,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,10 +801,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -804,7 +828,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +853,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateways_operations.py index 5319de0bbb21b..df61ac42f703e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -541,7 +559,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -605,8 +623,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +676,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -679,7 +697,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -704,7 +722,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -807,7 +831,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -825,7 +855,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -881,7 +911,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -931,7 +961,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -949,7 +985,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1005,7 +1041,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1055,7 +1091,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,8 +1237,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1242,7 +1290,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1262,7 +1310,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1287,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1366,8 +1420,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1416,7 +1470,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1435,7 +1489,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1459,7 +1513,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1480,8 +1540,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1532,7 +1592,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1553,7 +1613,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1578,7 +1638,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1596,11 +1662,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1652,10 +1718,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1677,7 +1743,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1702,7 +1768,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1722,8 +1794,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1770,7 +1842,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1790,7 +1862,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1814,7 +1886,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1832,7 +1910,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1902,8 +1980,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1952,7 +2030,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -1971,7 +2049,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1995,7 +2073,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_peerings_operations.py index 4f805228e1a00..ec8ddb8dcfa66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_taps_operations.py index e46b7f0acccce..195c95324aee8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_networks_operations.py index 60bd715635f16..b964567fdc863 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_04_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_wans_operations.py index 1f04131141218..0b4a6c57e3d7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_connections_operations.py index 65f072ff01a7f..3875e7d71d212 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_gateways_operations.py index a130018ecbfe6..fa56bd72399d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,8 +487,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -537,7 +555,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -590,7 +614,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +660,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -651,7 +675,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -659,7 +683,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +728,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_configuration_operations.py index 066400e8ae460..1bb4e36b5ab70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_operations.py index e50aa5cd8a5e8..04952cb278851 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_web_application_firewall_policies_operations.py index 840685c1a2974..c4192c77d8a83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_metadata.json index b1acf775b3723..5ab7239dc0c5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -142,7 +143,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_06_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -154,7 +155,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_network_management_client.py index b8a7e11e904eb..4f7625db60973 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/_network_management_client.py @@ -294,7 +294,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/_network_management_client.py index 635c6fd6ebc00..a27a5acc22bee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/_network_management_client.py @@ -291,7 +291,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_gateways_operations.py index 607343719c479..08cd595c6597c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -898,11 +934,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -956,10 +992,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -982,7 +1018,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1008,7 +1044,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1062,7 +1104,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1113,7 +1155,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1164,7 +1206,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1178,7 +1220,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1186,7 +1228,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1228,7 +1270,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1236,7 +1278,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1278,7 +1320,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1286,7 +1328,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1345,7 +1387,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1355,7 +1397,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_security_groups_operations.py index c0f61ce525dfc..80cd63ba9d923 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_delegations_operations.py index 6d4c73cfdc9fe..2c262eab0b0c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_endpoint_services_operations.py index dd32809b642c9..d84f041a92ea5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_private_endpoint_types_operations.py index a5e7b9290d371..591d77d31ed9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_resource_group_delegations_operations.py index 0e98054d5d89f..3e6900418e091 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index e45cfcb347d76..848f44fe8611b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewalls_operations.py index 1817c2dacda72..e6c1148830da5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,9 +339,9 @@ async def update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Updates tags for an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -343,7 +355,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +482,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bastion_hosts_operations.py index 3ea88af88fd5d..d2ff8d8765797 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, bastion_host_name: str, - bastion_host_parameters: "models.TagsObject", + bastion_host_parameters: "_models.TagsObject", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -366,7 +378,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, bastion_host_name: str, - bastion_host_parameters: "models.TagsObject", + bastion_host_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Updates bastion host tags. :param resource_group_name: The resource group name of the BastionHost. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bgp_service_communities_operations.py index 3b4326dfa7793..2cfacd6a42e0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_connection_monitors_operations.py index e15f132eb8bd5..de912327c72a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_custom_policies_operations.py index 4ad8feb73619c..c0a058f465462 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_protection_plans_operations.py index 57ba032f53735..150f1763228a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_default_security_rules_operations.py index 20812ee711fb9..76b775f3db76a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_authorizations_operations.py index d62cbe2114c05..07d91164df912 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_connections_operations.py index 61c49eb56a455..8d6c6b479971d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_peerings_operations.py index 66c6dc2d5a926..011164de4b725 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuits_operations.py index f0c13ee36cdbe..d69af8ce7de95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_connections_operations.py index 6496f4b44bdbe..83a0bdb797bbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 1a4e138779f69..8c14406ab51aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connections_operations.py index ef60fb0e731a0..50365e8a0f4d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_gateways_operations.py index fd67fd1efa2a1..1f7322b433ab1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_links_operations.py index 9daf926d0998c..cad040a0fda8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_locations_operations.py index af26786f6788e..14b26b75b142c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_operations.py index 68f5a5350233f..dd545078b41cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_service_providers_operations.py index c2a3afc48d02a..26e8deb6b33aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policies_operations.py index fa63f8dd48f7a..b2f91614a161a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def update_tags( self, resource_group_name: str, firewall_policy_name: str, - firewall_policy_parameters: "models.TagsObject", + firewall_policy_parameters: "_models.TagsObject", **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Updates a Firewall Policy Tags. :param resource_group_name: The resource group name of the Firewall Policy. @@ -226,7 +232,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +268,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FirewallPolicy', pipeline_response) @@ -277,10 +283,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,9 +340,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -356,7 +362,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policy_rule_groups_operations.py index 9cb9dd1c9b24a..259961a7d3aab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_hub_virtual_network_connections_operations.py index f519348cb0901..904b6e803c2fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_inbound_nat_rules_operations.py index cd19d1e2d9ccd..1c27cf1bd0416 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py index e72b256c90a3e..20b3b1523d071 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index f0edb86ed53fe..d42051e55c675 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 899fd69f64f69..3ab2309c75cc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_network_interfaces_operations.py index ef2498a90c0dc..e79229a0f6ca9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_outbound_rules_operations.py index 23bd513adc125..4f924b8b490be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_probes_operations.py index f331fe9752538..0a71feb1a9497 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancers_operations.py index 8a68b40d7d287..2385aa3e7f1d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_local_network_gateways_operations.py index 4a506020f86a5..cde4fb4eec495 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_nat_gateways_operations.py index 4b05fd87398eb..1d5cd751a60c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,9 +276,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_ip_configurations_operations.py index a85ad6b56495f..0c191ffe58c05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_load_balancers_operations.py index 5758496a147e4..b8a9c7f2d66ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_tap_configurations_operations.py index b2e95ae4f113b..3e164b76a11fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interfaces_operations.py index d47a10379a0aa..4dc9795ebb823 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_management_client_operations.py index 86bcb79a78cf2..a94d2bf08678b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_profiles_operations.py index 91bbe3e44a2ad..bc1f420649810 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_security_groups_operations.py index 6da214ad77d58..5ff0211587cf1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_watchers_operations.py index 2bf3a2c7365b6..17d14abda0f31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1865,7 +1931,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1890,7 +1956,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_operations.py index ac09763469996..28ccde05bb50f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_gateways_operations.py index e2c0c40d4e1e0..1f227daa607aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,8 +741,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +790,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -785,7 +809,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -809,7 +833,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_server_configurations_operations.py index 226b963a8c68d..ec6e40c03cfec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_packet_captures_operations.py index fb5cc1373688f..0ef131df1e669 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py index b777d1732e961..a5413f3075a74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_endpoints_operations.py index 9192ba0f8cbae..5316240144f64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_link_services_operations.py index b380aabdc8857..5603f84676646 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -476,9 +488,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -494,7 +506,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -581,7 +593,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -637,7 +649,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -654,10 +673,10 @@ def get_long_running_output(pipeline_response): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -707,9 +726,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -727,7 +746,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -751,7 +770,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -769,10 +793,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,9 +848,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -846,7 +870,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -871,7 +895,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -889,7 +919,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -900,7 +930,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -961,7 +991,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -974,7 +1004,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_addresses_operations.py index 7c140d5da835b..55d69d95cbcc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_prefixes_operations.py index 6f0f250e86de3..cd1ab4e052d74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_resource_navigation_links_operations.py index f9ff750bccecd..c4b02a65cd3ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filter_rules_operations.py index 0dda090fa8fc6..4f5f190159742 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filters_operations.py index 52f1e22f03f0e..4c8851cc3aab2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_tables_operations.py index da5f1ed7b31bb..10241adfbd3b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_routes_operations.py index 805ee61fbbf5a..cadf86095d679 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_security_rules_operations.py index fe2ee09fe979d..ef13333a04b70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_association_links_operations.py index 55c71ffb44fde..10d465d1a23bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policies_operations.py index 76ab059ed4968..da118bd47487b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py index b392ca7144248..d8e19659c2973 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_tags_operations.py index cc5ffa0a446e2..c7c82bb2c0cd9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_subnets_operations.py index 41da696cdd486..7c84256863cdb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -399,7 +413,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -447,7 +461,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -466,7 +487,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -516,7 +537,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -564,7 +585,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -583,7 +611,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -595,7 +623,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_usages_operations.py index 98a497eec8bd1..de9ff9fa8ddef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_hubs_operations.py index 439b21dd0eaf3..5da7e119353ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateway_connections_operations.py index 7af0df6adf33f..369b8654fc6d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -434,7 +446,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -452,10 +470,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -509,9 +527,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -534,7 +552,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -559,7 +577,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -578,7 +602,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -592,7 +616,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -637,7 +661,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -648,7 +672,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -708,10 +732,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,9 +787,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -789,7 +813,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -814,7 +838,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateways_operations.py index 61e94fdee1b87..23b35a8acbbd5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -382,9 +394,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -429,7 +441,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,7 +465,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -457,7 +475,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -530,7 +548,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,8 +611,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -645,7 +663,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -666,7 +684,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -691,7 +709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -792,7 +816,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -810,7 +840,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -865,7 +895,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -914,7 +944,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -932,7 +968,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -987,7 +1023,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1036,7 +1072,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1147,7 +1189,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,8 +1215,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1219,7 +1267,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1239,7 +1287,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1264,7 +1312,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,8 +1395,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1390,7 +1444,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1409,7 +1463,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1433,7 +1487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1453,8 +1513,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1504,7 +1564,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1525,7 +1585,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1550,7 +1610,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1568,10 +1634,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1623,9 +1689,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1647,7 +1713,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1672,7 +1738,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1691,8 +1763,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1738,7 +1810,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1758,7 +1830,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1782,7 +1854,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1800,7 +1878,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1868,8 +1946,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1917,7 +1995,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -1936,7 +2014,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1960,7 +2038,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_peerings_operations.py index 107ca316598fb..8c6f87f5ba1cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_taps_operations.py index fcb138ed5c051..7a06b5e5ecbd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_networks_operations.py index 3a5af83357fd3..f9fd011d97e5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_wans_operations.py index d6c6b617908dc..d74c727b4cbae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_connections_operations.py index 6fb4d3c7abeda..59ab56871c03d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_gateways_operations.py index a5a3545fdc31e..c4bc9f56e76dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,8 +475,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +524,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -524,7 +542,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -548,7 +566,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -566,7 +590,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -576,7 +600,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -622,7 +646,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -636,7 +660,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -644,7 +668,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,7 +713,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_link_connections_operations.py index 523ed113cafab..f490f5d469b4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_link_connections_operations.py index 5e21945744ce5..ec08ad950ed62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLinkConnection', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_links_operations.py index 992b548c18782..5637893f1b1e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLink', pipeline_response) @@ -109,7 +109,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -121,7 +121,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_configuration_operations.py index 4f37e5507de21..310e93b830330 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_operations.py index 6113747ba3fa5..23c736e471e26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_web_application_firewall_policies_operations.py index 2383b3120e64f..b84e71f0b4995 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_gateways_operations.py index b54c399891622..938115b73a527 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,12 +953,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -976,11 +1012,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -1003,7 +1039,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1029,7 +1065,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1084,7 +1126,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1136,7 +1178,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1188,7 +1230,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1203,7 +1245,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1211,7 +1253,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1296,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1262,7 +1304,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1305,7 +1347,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1313,7 +1355,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1373,7 +1415,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1383,7 +1425,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_security_groups_operations.py index d5aaab1df11aa..b0248928772d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_delegations_operations.py index f0f793d23061f..ff84bdfd9c807 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_endpoint_services_operations.py index 921e09cf01332..c4b63a33b4036 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_private_endpoint_types_operations.py index e00252630e409..2af70b40d73a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_resource_group_delegations_operations.py index c5f99d0fd71ef..5cf36e2a1c883 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewall_fqdn_tags_operations.py index 97a639cc14326..e41312a006908 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewalls_operations.py index 67d286f9b9a48..3b9de55fd4166 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,10 +348,10 @@ def update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Updates tags for an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -482,7 +494,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bastion_hosts_operations.py index 40dd3f2f60203..c2a9263d90776 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bastion_host_parameters, # type: "models.TagsObject" + bastion_host_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -376,7 +388,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str bastion_host_name, # type: str - bastion_host_parameters, # type: "models.TagsObject" + bastion_host_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Updates bastion host tags. :param resource_group_name: The resource group name of the BastionHost. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bgp_service_communities_operations.py index 674eae523fed6..d8438ed78cc17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_connection_monitors_operations.py index 3ca6e3d39947e..0c551b8302e42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_custom_policies_operations.py index 5344ede7bea86..2c097c933c49f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_protection_plans_operations.py index 1d396e626eb63..e019ed3038f3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_default_security_rules_operations.py index 9fe541d426f38..70fd1a86bae60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_authorizations_operations.py index 9fd951a4d0abc..8adb2067e93a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_connections_operations.py index 0cc36b12f0c6e..e05d9bffc4fda 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_peerings_operations.py index 2472644e451f6..fa9e500ad075b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuits_operations.py index 35b02634b8cbc..c1fc82a5c7ee4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_connections_operations.py index caf3d3c87ad50..61cdae3b215ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connection_peerings_operations.py index bf0dc40962c55..61dea78c02f7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connections_operations.py index 6c9a0bff854ff..238748c69e598 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_gateways_operations.py index 8cc7ad9c15964..f434b39b795b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_links_operations.py index e338814a14ee8..b5c4d86619719 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_locations_operations.py index 8a77d56989f8e..de2d91739ac74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_operations.py index 389db795be265..f8b799ac68809 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_service_providers_operations.py index 65ca5500973a8..34649ef9fe128 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policies_operations.py index 89164143575ad..98dd27b783bed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def update_tags( self, resource_group_name, # type: str firewall_policy_name, # type: str - firewall_policy_parameters, # type: "models.TagsObject" + firewall_policy_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Updates a Firewall Policy Tags. :param resource_group_name: The resource group name of the Firewall Policy. @@ -234,7 +240,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +276,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FirewallPolicy', pipeline_response) @@ -285,11 +291,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,10 +349,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -366,7 +372,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policy_rule_groups_operations.py index a495077620a15..f397eefb66764 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_hub_virtual_network_connections_operations.py index 1c645e84b79b0..358127f57394f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_inbound_nat_rules_operations.py index 025af7c49850f..784a2396adbcb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_backend_address_pools_operations.py index 8318199b82998..3e41b889dde47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py index a3037655689bd..9c8d7b50957f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_load_balancing_rules_operations.py index 2c8eb44ae0b7e..a891b7d146dee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_network_interfaces_operations.py index 946688968d33e..7f8066ca0c52a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_outbound_rules_operations.py index 11b25a3c1c087..91b0edd839054 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_probes_operations.py index 910435f0fa9ce..5225c92667147 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancers_operations.py index a4049630704d9..305659efeaac6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_local_network_gateways_operations.py index 3d4d31e97e7e0..f09bccbfe2bb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_nat_gateways_operations.py index 9c16cfc5e0480..b3a3c61cf3919 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_ip_configurations_operations.py index f5a15743d4c52..a7d779c6f2567 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_load_balancers_operations.py index 2b43e95189eb3..9d5955cce0494 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_tap_configurations_operations.py index e3a1f172bbb6c..72a46f3f34b7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interfaces_operations.py index 7dae8c1355234..6a66297bc4225 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_management_client_operations.py index ff18432b0bc98..62a803b80385b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_profiles_operations.py index 3ad4d080fbb84..f4469175e06ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_security_groups_operations.py index 7f373a26d2346..3c4a23aaa88c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_watchers_operations.py index a3f0000ed2ec6..f79600c2ced56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1899,7 +1965,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1990,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_operations.py index 809ff487fec86..627ce0262b729 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_gateways_operations.py index ddae984c0b2b9..0ca877190fd01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,8 +757,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -783,7 +807,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -802,7 +826,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -826,7 +850,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_server_configurations_operations.py index ea6e4adb5308b..508681f60619c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_packet_captures_operations.py index dff835340cd67..995c7f3f72679 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_peer_express_route_circuit_connections_operations.py index e92d471e8c43c..777c362fecfd1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_endpoints_operations.py index ea59fab6f7493..6e957dc0db50e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_link_services_operations.py index ce85954910e6e..f4d9c02aa58e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,10 +499,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -506,7 +518,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +555,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -594,7 +606,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -651,7 +663,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -668,11 +687,11 @@ def get_long_running_output(pipeline_response): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,10 +741,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -743,7 +762,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -767,7 +786,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -785,11 +809,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -841,10 +865,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks the subscription is visible to private link service. :param location: The location of the domain name. @@ -864,7 +888,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -889,7 +913,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -908,7 +938,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -919,7 +949,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -981,7 +1011,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -994,7 +1024,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_addresses_operations.py index dfb485eb14990..4e925449cb50f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_prefixes_operations.py index 816575e227553..74d31fcd6b3c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_resource_navigation_links_operations.py index 7cf1ac7b5ecd4..92e8cb9e894a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filter_rules_operations.py index b3e0291d94c7c..0d8e6e6021363 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filters_operations.py index 39e08baeb7fd7..88bddb7c542ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_tables_operations.py index b3f38df2f181c..4925f90dab1bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_routes_operations.py index 972f330f4c1db..f103f15f7d0a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_security_rules_operations.py index 6113cbee1e8e6..600d13d4a12f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_association_links_operations.py index 2d7c33e7fafa7..7eff66d369463 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policies_operations.py index a772f918506dd..73d9f95e36ee0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policy_definitions_operations.py index 0f999abf90e58..7d2bc2284fbf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_tags_operations.py index 12261374fd051..eea944d3ef00f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_subnets_operations.py index e602b0d1967be..9cfbeca4ee5c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,7 +372,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -409,7 +423,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -477,7 +498,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -528,7 +549,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -577,7 +598,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -597,7 +625,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -609,7 +637,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_usages_operations.py index 87cfeb04658dc..c7ba85f8112a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_hubs_operations.py index ee707d1187afb..e81b918436068 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateway_connections_operations.py index 849bca942e7e2..dc101e12b2f19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,11 +481,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -521,10 +539,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -547,7 +565,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -572,7 +590,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -592,7 +616,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -606,7 +630,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -652,7 +676,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -663,7 +687,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -723,11 +747,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,10 +803,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -806,7 +830,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -831,7 +855,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py index 73f313bf9f874..1c19eef499db8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -392,10 +404,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -440,7 +452,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,7 +477,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -469,7 +487,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -543,7 +561,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -607,8 +625,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -660,7 +678,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -681,7 +699,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -706,7 +724,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -809,7 +833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,7 +857,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -883,7 +913,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -951,7 +987,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1007,7 +1043,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1057,7 +1093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1170,7 +1212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1191,8 +1239,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1244,7 +1292,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1264,7 +1312,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1289,7 +1337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1368,8 +1422,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1418,7 +1472,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1437,7 +1491,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1461,7 +1515,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,8 +1542,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1534,7 +1594,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1555,7 +1615,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1580,7 +1640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1598,11 +1664,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1654,10 +1720,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1679,7 +1745,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1704,7 +1770,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1724,8 +1796,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1772,7 +1844,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1792,7 +1864,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1816,7 +1888,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1834,7 +1912,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1904,8 +1982,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1954,7 +2032,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -1973,7 +2051,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1997,7 +2075,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_peerings_operations.py index 68a47152e2a10..b7a6c28eb7f31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_taps_operations.py index 3de232e8b56f3..ecc3fa55528dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_networks_operations.py index 2de9e3f0093c0..3edb0c1600512 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_wans_operations.py index 68101ad47b53a..e185577c9a676 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_connections_operations.py index 212bd8586d7bf..fa5aef815bc20 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_gateways_operations.py index f3930d98f173e..7350a3243d39f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,8 +487,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -537,7 +555,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -590,7 +614,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +660,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -651,7 +675,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -659,7 +683,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +728,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_link_connections_operations.py index f0896605698ed..14cc2fad5b100 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_link_connections_operations.py index 9b9149a3827fb..9fac9797d222d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,7 +101,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLinkConnection', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_links_operations.py index ff278dc143a7c..77e13e77a74f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLink', pipeline_response) @@ -115,7 +115,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -127,7 +127,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_configuration_operations.py index 389234d54f5b0..99f21ab128900 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_operations.py index 3ac488cedcf0e..daddd52fee4ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_web_application_firewall_policies_operations.py index 79516858f2e3f..3ee8e983961a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_metadata.json index 3e2086234d517..c5f8b0ebb95ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -144,7 +145,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_07_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -156,7 +157,7 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_network_management_client.py index cf7a258d26cfe..141b47bea732a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/_network_management_client.py @@ -300,7 +300,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/_network_management_client.py index 9f14d21f2b3ee..c2c69a1def475 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/_network_management_client.py @@ -297,7 +297,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_gateways_operations.py index bf71d28c49d6a..76087608d09ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -898,11 +934,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -956,10 +992,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -982,7 +1018,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1008,7 +1044,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1062,7 +1104,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1113,7 +1155,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1164,7 +1206,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1178,7 +1220,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1186,7 +1228,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1228,7 +1270,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1236,7 +1278,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1278,7 +1320,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1286,7 +1328,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1345,7 +1387,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1355,7 +1397,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_security_groups_operations.py index 4e3956959420f..3279b2470e2f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_delegations_operations.py index 0d999599e5d27..b75266eb3ff80 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_endpoint_services_operations.py index 4224746025bee..ed4236c85de68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_private_endpoint_types_operations.py index ab77c696a4595..4962238a89014 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_resource_group_delegations_operations.py index 9026681a053eb..905263b71b0b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index f6f3673b69b4a..c65cb8a0dc8de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewalls_operations.py index c11043b14d28e..f58e6645200ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,9 +339,9 @@ async def update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Updates tags for an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -343,7 +355,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +482,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bastion_hosts_operations.py index af7281ffa6d02..a0e4753d2dddf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bgp_service_communities_operations.py index 874212d5881d8..dcb66153397fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_connection_monitors_operations.py index 785774ae3944c..e80c2fbb8ff5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_custom_policies_operations.py index 446114da1d374..5e6fe83697d19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_protection_plans_operations.py index 6d02e653c584a..894fb2aad17d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_default_security_rules_operations.py index bcb599fe4b692..6b96e8da74688 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_authorizations_operations.py index f26112ae6fe98..ee2a6b422b80a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_connections_operations.py index 228cc1f9bd406..72f56390287ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_peerings_operations.py index 0aaf0727effd3..dd3c5b4a5f868 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuits_operations.py index bc144031b8698..aa8a2dc88ecac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_connections_operations.py index a9cc9a10fd412..6b9564b1a044e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 25fd209dab04e..67981d9835e26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connections_operations.py index ec470d45d41f9..536dc0664625a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_gateways_operations.py index e1c106f321c4f..ec65bb4a04f4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_links_operations.py index fabeee47c1c5f..49f46291c912f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_locations_operations.py index 26c4997a4edfb..5358a237b5309 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_operations.py index 0a13a86e90315..65ba1a7346f39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_service_providers_operations.py index a4dcf0dd19b11..0f2f5065a0afc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policies_operations.py index 732ad3fe7018d..b84d852267bf8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def update_tags( self, resource_group_name: str, firewall_policy_name: str, - firewall_policy_parameters: "models.TagsObject", + firewall_policy_parameters: "_models.TagsObject", **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Updates a Firewall Policy Tags. :param resource_group_name: The resource group name of the Firewall Policy. @@ -226,7 +232,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +268,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FirewallPolicy', pipeline_response) @@ -277,10 +283,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,9 +340,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -356,7 +362,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policy_rule_groups_operations.py index f07cb15e51970..21fb1199c54ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_hub_virtual_network_connections_operations.py index 84e37675dfdf7..046b33ddaae7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -109,7 +109,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -121,7 +121,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py index bf36a8bd0956b..d1cb3ddba8f9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 88003967b53da..8976774a24237 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index d99559644fe79..17a7bba2207b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index d467cce1c61e0..0e0e5982bb71a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_network_interfaces_operations.py index 508c12b8cf1fe..a2a85e94903a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_outbound_rules_operations.py index b60fdc362557c..c6953fec0510b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_probes_operations.py index 5b310e9aecedb..33a7bb4063c56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancers_operations.py index 8572bf5ef4fe2..2c4bb978e251f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_local_network_gateways_operations.py index a8871229c8661..faf6d4d1a4fd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_nat_gateways_operations.py index 4b534d2cf7025..02a89e99f08ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,9 +276,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_ip_configurations_operations.py index 1899294affb4d..12ae970d12d8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_load_balancers_operations.py index 7c5a5a8a8c9bc..b48cd5bf5b374 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_tap_configurations_operations.py index 2d86d1ca071d1..f922346399f6f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interfaces_operations.py index 279c364b7f8b3..d08e690ca5375 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_management_client_operations.py index ea8bc320b7e34..bf95c00eaeb14 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -38,7 +38,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_07_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -97,7 +97,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ async def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_profiles_operations.py index 1fd0d695924b9..2dc241dba6021 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_security_groups_operations.py index f8596dd5453bd..12cabd2b503df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_watchers_operations.py index d2e8352030cce..0c349a7bdd351 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_07_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1869,7 +1935,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1894,7 +1960,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_operations.py index a467234f8662e..a39634582b416 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_gateways_operations.py index 608decd2b966f..a36ace6d25e2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -311,7 +317,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -387,7 +399,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -527,7 +545,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +598,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -595,10 +613,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -650,9 +668,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,8 +741,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +790,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -785,7 +809,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -809,7 +833,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_server_configurations_operations.py index f0eba9cc77bc8..a6b8441e29732 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> "_models.P2SVpnServerConfiguration": """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + ) -> "_models.P2SVpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, - p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", + p2_s_vpn_server_configuration_parameters: "_models.P2SVpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_virtual_wan( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListP2SVpnServerConfigurationsResult"]: """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -363,7 +377,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +424,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_packet_captures_operations.py index 5f43c035c6b33..1f2d8d01a2d8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py index 98154b6ccb8f2..33ef52debd5fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_endpoints_operations.py index 584d24f96a14d..9c7cc301ecb49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_link_services_operations.py index 27360342d91b6..1c046a2d6d5f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -476,9 +488,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -494,7 +506,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -581,7 +593,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -637,7 +649,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -654,10 +673,10 @@ def get_long_running_output(pipeline_response): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -707,9 +726,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -727,7 +746,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -751,7 +770,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -769,10 +793,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,9 +848,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -847,7 +871,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -872,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -890,7 +920,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -901,7 +931,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -975,7 +1005,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_addresses_operations.py index 1d06b38012592..b44e13b8f436f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_prefixes_operations.py index ac21f1d888863..1be548049a168 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_resource_navigation_links_operations.py index c4b357e710a07..90626abe3171e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filter_rules_operations.py index b60f6fce1efae..1ec731da68683 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filters_operations.py index cc0f12731fd85..d977168534003 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_tables_operations.py index 4fb96994ec0e6..12d13ffd6f5a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_routes_operations.py index 5b3bbb475b196..b59499bb0f6d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_security_rules_operations.py index e61b9e6a3c6e5..8e2893b521597 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_association_links_operations.py index 4eff7aff7109f..94c1818c091d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policies_operations.py index 07ad473504f4a..601110ec0614a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 6cd1339da50e4..f52fcfeb21db0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_tags_operations.py index 2d035834e21b0..75eb8f702001f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_subnets_operations.py index d96c6b1e4df43..d8cf2ea2d41a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -399,7 +413,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -447,7 +461,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -466,7 +487,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -516,7 +537,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -564,7 +585,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -583,7 +611,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -595,7 +623,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_usages_operations.py index 0691a56827a81..6b0646effa926 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_hubs_operations.py index b6cac9c152fbb..28d77eb1c3e07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateway_connections_operations.py index d2417aa2a66c9..fc20f6d9f29dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -434,7 +446,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -452,10 +470,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -509,9 +527,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -534,7 +552,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -559,7 +577,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -578,7 +602,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -592,7 +616,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -637,7 +661,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -648,7 +672,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -708,10 +732,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,9 +787,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -789,7 +813,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -814,7 +838,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -832,7 +862,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -874,7 +904,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -891,7 +921,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -940,7 +970,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -958,7 +994,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -997,7 +1033,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1014,7 +1050,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1063,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateways_operations.py index 6aa7432b93ece..6abd4500e9119 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -382,9 +394,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -429,7 +441,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,7 +465,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -457,7 +475,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -530,7 +548,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,8 +611,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -645,7 +663,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -666,7 +684,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -691,7 +709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -792,7 +816,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -810,7 +840,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -865,7 +895,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -914,7 +944,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -932,7 +968,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -987,7 +1023,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1036,7 +1072,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1147,7 +1189,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,8 +1215,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1219,7 +1267,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1239,7 +1287,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1264,7 +1312,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,8 +1395,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1390,7 +1444,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1409,7 +1463,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1433,7 +1487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1453,8 +1513,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1504,7 +1564,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1525,7 +1585,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1550,7 +1610,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1568,10 +1634,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1623,9 +1689,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1647,7 +1713,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1672,7 +1738,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1691,8 +1763,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1738,7 +1810,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1758,7 +1830,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1782,7 +1854,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1800,7 +1878,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1867,7 +1945,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1909,7 +1987,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1926,7 +2004,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1974,7 +2052,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1992,7 +2076,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2031,7 +2115,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2048,7 +2132,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2096,7 +2180,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2115,8 +2205,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2164,7 +2254,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2183,7 +2273,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2207,7 +2297,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_peerings_operations.py index 30e29400b490d..541edde66247e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_taps_operations.py index c716fa794a978..913835bdaef02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_networks_operations.py index 4d9db79e52d70..15bc548607157 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_07_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_router_peerings_operations.py index 6559530c91782..264232bba7444 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,9 +227,9 @@ async def update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Updates a Virtual Router Peering. :param resource_group_name: The resource group name of the Virtual Router Peering. @@ -238,7 +245,7 @@ async def update( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,7 +282,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -291,10 +298,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -331,7 +338,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -421,7 +435,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -433,7 +447,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +494,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_routers_operations.py index bf9dff290c409..45692d5659619 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,9 +220,9 @@ async def update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Updates a Virtual Router. :param resource_group_name: The resource group name of the Virtual Router. @@ -230,7 +236,7 @@ async def update( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -266,7 +272,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -281,10 +287,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -339,9 +345,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -386,7 +392,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -404,7 +416,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -474,7 +486,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -482,7 +494,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +539,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_wans_operations.py index 8d2649ae91cfd..5b10e6d440d74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_connections_operations.py index a841861def43f..9432cffa1c892 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -196,7 +196,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -222,7 +222,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -275,7 +282,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -362,7 +376,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_gateways_operations.py index 8f4211de4ab06..f792298a214e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +275,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,9 +294,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,7 +398,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -457,8 +475,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -506,7 +524,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -524,7 +542,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -548,7 +566,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -566,7 +590,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -576,7 +600,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -622,7 +646,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -636,7 +660,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -644,7 +668,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,7 +713,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_link_connections_operations.py index 6c9d30e5fab40..a9c145b90aecf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_link_connections_operations.py index df53f178360bd..2be6119f04297 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLinkConnection', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_links_operations.py index bf482fb729c21..5d2397b35f0f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLink', pipeline_response) @@ -109,7 +109,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -121,7 +121,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_configuration_operations.py index 3a13852d97112..df4c4497a3966 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -85,7 +85,7 @@ async def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -97,7 +97,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -142,7 +142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_operations.py index 71a96ef787482..0788b85247c56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -106,10 +106,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -145,7 +145,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -164,9 +164,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -186,7 +186,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -211,7 +211,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,10 +235,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +274,7 @@ async def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -309,7 +315,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +340,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -385,7 +397,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -525,7 +543,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -533,7 +551,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +596,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_web_application_firewall_policies_operations.py index 802e8d2e8e183..dbaa2cc40cecf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_gateways_operations.py index ef8b6f105a078..14dee53283355 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,12 +953,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -976,11 +1012,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -1003,7 +1039,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1029,7 +1065,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1084,7 +1126,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1136,7 +1178,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1188,7 +1230,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1203,7 +1245,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1211,7 +1253,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1296,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1262,7 +1304,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1305,7 +1347,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1313,7 +1355,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1373,7 +1415,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1383,7 +1425,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_security_groups_operations.py index 3cf419c0be201..378181c66ded1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_delegations_operations.py index 63560c604ddef..b78b152964b51 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_endpoint_services_operations.py index 4e9192bbdde28..0acb8d9c8d7d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_private_endpoint_types_operations.py index edd1a27953fc4..db11bbb1cfe4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_resource_group_delegations_operations.py index d6a38410df9c4..6351dd715a953 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewall_fqdn_tags_operations.py index 562cade150878..4e9b58b9ae136 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewalls_operations.py index d1a35f7f238e1..c49083d37f3bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,10 +348,10 @@ def update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Updates tags for an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -482,7 +494,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bastion_hosts_operations.py index ef4f930efa18a..5e283bd505c67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bgp_service_communities_operations.py index 39566beed939b..24900f5f4e859 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_connection_monitors_operations.py index 9a7a8aa3b377a..abf432bc16b77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_custom_policies_operations.py index 549920ae5c01b..bea3d1de75182 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py index f653593d78e1f..f714dbac06e64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_default_security_rules_operations.py index 13abc96160741..8573374fb978a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_authorizations_operations.py index d54019b2c82dd..e72e6f5b489d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_connections_operations.py index 705aa1a4565c8..93e99d3366b0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_peerings_operations.py index 1d1a1b7831e5e..5d2774c4a5dab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuits_operations.py index d3a25eed78d51..a3270d1cc3278 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_connections_operations.py index 22bc91861b3eb..134c029cacb83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py index 4a087a38feef7..9a49d3a5beaf2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connections_operations.py index e2d1384339df5..32ae63301c18b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_gateways_operations.py index 79167ce6220e5..4b3ccece0a9b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_links_operations.py index 77d414ff5a015..a3ebf42ec626b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_locations_operations.py index 43cc029d008d2..8424a4da566b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_operations.py index 09a17860c290b..e9b4cf809d3ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_service_providers_operations.py index 0593b13d21191..ce27db6476c7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policies_operations.py index a3f4ab471b407..db40ea901dc54 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def update_tags( self, resource_group_name, # type: str firewall_policy_name, # type: str - firewall_policy_parameters, # type: "models.TagsObject" + firewall_policy_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Updates a Firewall Policy Tags. :param resource_group_name: The resource group name of the Firewall Policy. @@ -234,7 +240,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +276,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FirewallPolicy', pipeline_response) @@ -285,11 +291,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,10 +349,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -366,7 +372,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policy_rule_groups_operations.py index 3342136c6260a..71626d4f4edf1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_hub_virtual_network_connections_operations.py index 200759db0340e..b9de2a93ab34d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) @@ -115,7 +115,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -127,7 +127,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_inbound_nat_rules_operations.py index b63dd28bf1925..2b1a64e36002e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_backend_address_pools_operations.py index 05b1dc24e68f6..14f3bbc5fcf18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py index fa7aaaa6eaefd..f6a74bc36a16a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_load_balancing_rules_operations.py index d124af927f3a6..364c1df4afca9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_network_interfaces_operations.py index 7526e56208c57..fffb88be79e82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_outbound_rules_operations.py index e8bbc0999362e..c3a390a7e29e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py index 8cb7f1e2f66fd..06d6df37d6670 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancers_operations.py index 5fc580807377e..197a9b84e57f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_local_network_gateways_operations.py index 586e3e88dd84a..80b9903c9c4e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_nat_gateways_operations.py index 9b1968e615665..b96d9b183e61e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_ip_configurations_operations.py index 959ddf040eae3..83bb869650b33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_load_balancers_operations.py index c4b12a7cb3cc4..a0a7bde4b6e01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_tap_configurations_operations.py index 4832305edd267..f9e98d3df8506 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interfaces_operations.py index 39d9a31fbbeb7..af843828d98ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_management_client_operations.py index 3b2acb8542f27..6d1669d4703d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_management_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -43,7 +43,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_07_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,7 +90,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -103,7 +103,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def supported_security_providers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_profiles_operations.py index c0c7a90e06697..636b745a08084 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_security_groups_operations.py index e10a1f3f2b863..432b2c3d86775 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_watchers_operations.py index 380d7595c8376..a8a2ae635c185 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_07_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1903,7 +1969,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1928,7 +1994,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_operations.py index fe0618d181799..5560c55ce6270 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_gateways_operations.py index 3aa27ba9166e3..3db57e0cf90e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -320,7 +326,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -540,7 +558,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +566,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +611,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -608,11 +626,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,10 +682,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,8 +757,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -783,7 +807,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -802,7 +826,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -826,7 +850,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_server_configurations_operations.py index 51e3da05c530f..6d5ee34758fca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_p2_svpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" + # type: (...) -> "_models.P2SVpnServerConfiguration" """Retrieves the details of a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('P2SVpnServerConfiguration', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + # type: (...) -> "_models.P2SVpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_wan_name, # type: str p2_s_vpn_server_configuration_name, # type: str - p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" + p2_s_vpn_server_configuration_parameters, # type: "_models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] + # type: (...) -> LROPoller["_models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWanName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'p2SVpnServerConfigurationName': self._serialize.url("p2_s_vpn_server_configuration_name", p2_s_vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_virtual_wan( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListP2SVpnServerConfigurationsResult"] """Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. :param resource_group_name: The resource group name of the VirtualWan. @@ -373,7 +387,7 @@ def list_by_virtual_wan( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListP2SVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -420,7 +434,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_packet_captures_operations.py index 86a6ae4ac8b54..85c8f2615bece 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_peer_express_route_circuit_connections_operations.py index 6f2a5683a4805..7c9af2a55592e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_endpoints_operations.py index 47fcbc487e975..15d33bae9a1c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_link_services_operations.py index 661b938d506a9..ca5db549101e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,10 +499,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -506,7 +518,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +555,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -594,7 +606,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -651,7 +663,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -668,11 +687,11 @@ def get_long_running_output(pipeline_response): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,10 +741,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -743,7 +762,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -767,7 +786,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -785,11 +809,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -841,10 +865,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -865,7 +889,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -890,7 +914,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -909,7 +939,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -920,7 +950,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -982,7 +1012,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -995,7 +1025,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_addresses_operations.py index a22b0f75a53f1..e4b7ccb4fda85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_prefixes_operations.py index 704d993e7011c..f7a105322864b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_resource_navigation_links_operations.py index e64956f1b634e..348ad0848d716 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filter_rules_operations.py index 6d63f69dca08b..8670a45c96d99 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filters_operations.py index 1eea0a32b91e1..44dd6984651c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_tables_operations.py index 5dd7e77417ee3..414bf4ae848ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_routes_operations.py index 2d9ec4c88fb52..82b2a5f75e6a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_security_rules_operations.py index b92be6e7f304d..416a335002d71 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_association_links_operations.py index 019b1d6445cc9..3a0ae4e99196d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policies_operations.py index 9dce49153c887..c013ac5fa6388 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policy_definitions_operations.py index 2ec159ec2f825..9560d39e02cc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_tags_operations.py index ba15641463fed..7df68b10ba619 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_subnets_operations.py index 338740efddee4..b15627cb70d5f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,7 +372,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -409,7 +423,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -477,7 +498,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -528,7 +549,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -577,7 +598,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -597,7 +625,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -609,7 +637,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_usages_operations.py index a9dda26c8c67b..874733483a9a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_hubs_operations.py index bec1a0114ce22..b9046550ac1c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHub', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateway_connections_operations.py index 3641aeb1beffc..564ee5eeb058d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,11 +481,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -521,10 +539,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -547,7 +565,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -572,7 +590,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -592,7 +616,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -606,7 +630,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -652,7 +676,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -663,7 +687,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -723,11 +747,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,10 +803,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -806,7 +830,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -831,7 +855,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -849,7 +879,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -892,7 +922,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -909,7 +939,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -959,7 +989,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -977,7 +1013,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1017,7 +1053,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1034,7 +1070,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1084,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateways_operations.py index 5d4b672d43619..36fdc0e4e2aad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -392,10 +404,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -440,7 +452,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,7 +477,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -469,7 +487,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -543,7 +561,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -607,8 +625,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -660,7 +678,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -681,7 +699,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -706,7 +724,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -809,7 +833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,7 +857,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -883,7 +913,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -951,7 +987,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1007,7 +1043,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1057,7 +1093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1170,7 +1212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1191,8 +1239,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1244,7 +1292,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1264,7 +1312,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1289,7 +1337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1368,8 +1422,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1418,7 +1472,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1437,7 +1491,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1461,7 +1515,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,8 +1542,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1534,7 +1594,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1555,7 +1615,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1580,7 +1640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1598,11 +1664,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1654,10 +1720,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1679,7 +1745,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1704,7 +1770,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1724,8 +1796,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1772,7 +1844,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1792,7 +1864,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1816,7 +1888,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1834,7 +1912,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1902,7 +1980,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1945,7 +2023,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1962,7 +2040,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2011,7 +2089,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2029,7 +2113,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2069,7 +2153,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2086,7 +2170,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2135,7 +2219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2155,8 +2245,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2205,7 +2295,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2224,7 +2314,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2248,7 +2338,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_peerings_operations.py index 0ed44220ceb2d..842eb9c091ed5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_taps_operations.py index 8960847a8fa27..f1e722422c1bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_networks_operations.py index 19f01182bae75..e76ca2d42d29c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_07_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_router_peerings_operations.py index 3835ea93a998e..c0e5ec6105b0b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,10 +234,10 @@ def update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Updates a Virtual Router Peering. :param resource_group_name: The resource group name of the Virtual Router Peering. @@ -246,7 +253,7 @@ def update( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +290,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -299,11 +306,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -340,7 +347,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -432,7 +446,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -444,7 +458,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -491,7 +505,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_routers_operations.py index e79b6326bd37b..7a5aabd50588e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,10 +227,10 @@ def update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Updates a Virtual Router. :param resource_group_name: The resource group name of the Virtual Router. @@ -238,7 +244,7 @@ def update( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -274,7 +280,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -289,11 +295,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -329,7 +335,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -348,10 +354,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -371,7 +377,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -396,7 +402,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -415,7 +427,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -425,7 +437,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -486,7 +498,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -494,7 +506,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +551,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_wans_operations.py index ed82b6ec479d6..9d52388dd0669 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualWAN', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_connections_operations.py index e689bb3321d16..76733a705fefa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnConnection', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -203,7 +203,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -229,7 +229,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +290,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -372,7 +386,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_gateways_operations.py index 0d026e7571936..c8dab73866633 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnGateway', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,7 +283,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -296,10 +302,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -396,7 +408,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -469,8 +487,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -537,7 +555,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -590,7 +614,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +660,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -651,7 +675,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -659,7 +683,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +728,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_link_connections_operations.py index c064c275743fe..af7955ceb953f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_link_connections_operations.py index f6184c435cc73..a6725b968385a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,7 +101,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLinkConnection', pipeline_response) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_links_operations.py index a60c26afddab1..48cbb3caca048 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSiteLink', pipeline_response) @@ -115,7 +115,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -127,7 +127,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_configuration_operations.py index 4c46c5c246e14..d40ca8906fc58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -90,7 +90,7 @@ def _download_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -102,7 +102,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -148,7 +148,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_operations.py index e884d15ea0836..e0ef8a992c396 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VpnSite', pipeline_response) @@ -111,11 +111,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,10 +170,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -193,7 +193,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -218,7 +218,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -236,11 +242,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +282,7 @@ def _update_tags_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -318,7 +324,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -538,7 +556,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -546,7 +564,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +609,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_web_application_firewall_policies_operations.py index 0904300930db7..1d1054ed4b2e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_07_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_metadata.json index 421d290e1ea1b..8312890a65334 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -146,7 +147,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_08_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -158,31 +159,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_08_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_08_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_08_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_08_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_network_management_client.py index 332bda7caa154..99739d70c5693 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/_network_management_client.py @@ -306,7 +306,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/_network_management_client.py index d23ffb5252550..3d428af0aa977 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/_network_management_client.py @@ -303,7 +303,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_gateways_operations.py index 28c9d30788f50..97a1023d8e972 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -663,7 +681,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -763,7 +787,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -783,8 +813,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -835,7 +865,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -855,7 +885,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -880,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -898,11 +934,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -956,10 +992,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -982,7 +1018,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1008,7 +1044,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1062,7 +1104,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1113,7 +1155,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1164,7 +1206,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1178,7 +1220,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1186,7 +1228,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1228,7 +1270,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1236,7 +1278,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1278,7 +1320,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1286,7 +1328,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1345,7 +1387,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1355,7 +1397,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_security_groups_operations.py index fb9c9edd646e6..32592d00d362e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -453,7 +471,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +530,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_delegations_operations.py index f95cae11fb84a..02b08df06bb1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_endpoint_services_operations.py index e93bec9008321..c8419ef4aa9d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_private_endpoint_types_operations.py index 39cbb7b7205a6..55bbf6f2e5e42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_resource_group_delegations_operations.py index 0434932523472..cce5fa8fb8236 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_service_aliases_operations.py index adc6eb80a50d0..eb42ca33c813a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index afe0608884e00..34cfbc665b112 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewalls_operations.py index c959ee0846a3b..cbd5130669079 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,9 +339,9 @@ async def update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Updates tags for an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -343,7 +355,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +482,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bastion_hosts_operations.py index f76089f839104..b24c99caa41be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +338,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -334,7 +346,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bgp_service_communities_operations.py index 3d75088f44b72..0ce3b93c99f7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_connection_monitors_operations.py index 589a5e635b55c..7c75f2b7b4ef8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_custom_policies_operations.py index c760122178514..44d6fcf793618 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,10 +340,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,9 +393,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -403,7 +415,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -428,7 +440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_protection_plans_operations.py index 25b9c21988743..23d8bb580cf70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_default_security_rules_operations.py index bd509cdfd1d47..7fb7b3546aa1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_authorizations_operations.py index 2d313282fed2c..21d503051a0f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py index a43e5351bbc81..08f5c5bc59fc3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -142,7 +142,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -163,7 +171,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -179,7 +187,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,10 +236,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -289,9 +297,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -316,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +351,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -363,7 +379,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -378,7 +394,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_peerings_operations.py index 115f97da59a7b..cea1390dd5497 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuits_operations.py index cfa54391acdf1..baa4f5ca0fdff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,8 +466,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -501,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -524,7 +542,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -550,7 +568,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -571,8 +597,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +650,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -647,7 +673,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -673,7 +699,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -694,8 +728,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -747,7 +781,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -770,7 +804,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +830,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -815,7 +857,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +869,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +916,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -888,7 +930,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +976,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -944,7 +986,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1003,7 +1045,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1011,7 +1053,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_connections_operations.py index 54af78ca779e0..235d5ae85e724 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 597e0002a9328..0214ae48ecb89 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -229,7 +236,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -243,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -349,9 +356,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -374,7 +381,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -400,7 +407,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connections_operations.py index 60574894bf29c..52815797a3720 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,10 +366,10 @@ async def _update_tags_initial( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def begin_update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -436,7 +442,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -482,8 +494,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +547,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -558,7 +570,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -584,7 +596,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -605,8 +625,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,7 +678,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -681,7 +701,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +727,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -728,8 +756,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,7 +809,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -804,7 +832,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_gateways_operations.py index cbbbebba0871b..9d23b73cbdbe8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_links_operations.py index f97a9a4d67317..b91663fda6a1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_locations_operations.py index f2f7504bd6c3c..9f4204f8a7956 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_operations.py index 742ba5554890c..254cea943aaf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -522,7 +540,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_service_providers_operations.py index 3fad3425c3ab5..7ce4bf8d2ceb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policies_operations.py index caf96e5e67a26..65c56abba4658 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def update_tags( self, resource_group_name: str, firewall_policy_name: str, - firewall_policy_parameters: "models.TagsObject", + firewall_policy_parameters: "_models.TagsObject", **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Updates a Firewall Policy Tags. :param resource_group_name: The resource group name of the Firewall Policy. @@ -226,7 +232,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +268,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FirewallPolicy', pipeline_response) @@ -277,10 +283,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,9 +340,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -356,7 +362,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policy_rule_groups_operations.py index c27c726f53d7e..35e6d4bc98c7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_hub_virtual_network_connections_operations.py index 463250da34717..77b5b3fd0f242 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_inbound_nat_rules_operations.py index 38b840bae99ab..d792567d2b325 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,7 +237,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +302,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,9 +361,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -379,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +412,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 93af52f21af88..61ef7b7194965 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 3bb958cd7a8ee..d5683775978f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 3759a70e4c9a2..5f661072387db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_network_interfaces_operations.py index 5b7f5774849fa..fae0ceeb7a4aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_outbound_rules_operations.py index 7fab55a2cd39c..d0b4518605c44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_probes_operations.py index 0da8b963f777f..26f0eae4b3535 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancers_operations.py index 72f702d731968..23ea11a62f3ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_local_network_gateways_operations.py index db3f85dc3bf2f..bd03d16bd9cbb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,7 +463,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -455,7 +473,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_nat_gateways_operations.py index ef3b479e893b1..b0b6d5d580dea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,9 +276,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_ip_configurations_operations.py index ad6c0f4e942c2..6c1de240fe429 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_load_balancers_operations.py index f7ec408955647..8f33c2bbc154d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_tap_configurations_operations.py index f40f67d6cd55a..f62bccdb62be9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interfaces_operations.py index 591a18f2fbd78..10a844288ae04 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,8 +605,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -636,7 +654,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -654,7 +672,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,8 +721,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +770,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -764,7 +788,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -788,7 +812,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +838,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -823,7 +853,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -898,7 +928,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -963,7 +993,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -981,7 +1011,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1034,7 +1064,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1052,7 +1082,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1152,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1142,7 +1172,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_management_client_operations.py index c1737637b8d05..cb84b7385bd46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_management_client_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,7 +27,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -40,7 +40,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_08_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -86,7 +86,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -99,7 +99,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -144,10 +144,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,9 +199,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -224,7 +224,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -249,7 +249,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_profiles_operations.py index e55ca9e508e44..bfe8c3bd38d86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +216,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -226,7 +232,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +351,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +359,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +418,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +428,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_security_groups_operations.py index 7c21f6c32263c..56c125e9147f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_watchers_operations.py index 9127003f95d3b..b50652e232174 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_08_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1869,7 +1935,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1894,7 +1960,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_operations.py index df3b6ed7369cf..2056e3a6f0744 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_p2_svpn_gateways_operations.py index bd8ddc4d05224..852f96d0d72e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,10 +234,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,9 +291,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -308,7 +314,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -333,7 +339,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -435,7 +447,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,7 +471,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -463,7 +481,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -522,7 +540,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -530,7 +548,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,10 +607,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -644,9 +662,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -667,7 +685,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -692,7 +710,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -711,8 +735,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -760,7 +784,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -779,7 +803,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -803,7 +827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -821,10 +851,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -876,9 +906,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -899,7 +929,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -924,7 +954,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_packet_captures_operations.py index d069f8a1cd910..07c91062064ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_peer_express_route_circuit_connections_operations.py index 7c71fa63cad99..daae007dbbfd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_endpoints_operations.py index afe0f314db3df..9721b90c738e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_link_services_operations.py index 71929f1addd30..7244ef5434387 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -476,9 +488,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -494,7 +506,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -581,7 +593,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -637,7 +649,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -654,10 +673,10 @@ def get_long_running_output(pipeline_response): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -707,9 +726,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -727,7 +746,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -751,7 +770,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -769,10 +793,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,9 +848,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -847,7 +871,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -872,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -890,7 +920,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -901,7 +931,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -975,7 +1005,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py index 043388aea0817..67f1433d17034 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -587,7 +605,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -599,7 +617,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -683,7 +701,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -753,7 +771,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -775,7 +793,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_prefixes_operations.py index 002fbdd4e5e3f..170e4eab4080a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_resource_navigation_links_operations.py index 5647de2d004fa..f37bb031386ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filter_rules_operations.py index 89d9d20e7e6e8..10d3728df9619 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,10 +359,10 @@ async def _update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,9 +414,9 @@ async def begin_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.PatchRouteFilterRule", + route_filter_rule_parameters: "_models.PatchRouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -425,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -482,7 +503,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filters_operations.py index d7012d0d4c9c8..9e8a913ab1373 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.PatchRouteFilter", + route_filter_parameters: "_models.PatchRouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_tables_operations.py index b1d4ef1625d99..c82c4393a192e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -460,7 +478,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -519,7 +537,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -527,7 +545,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_routes_operations.py index df49b4f21b708..0e02c2c53b071 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -299,7 +306,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +332,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -344,7 +358,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -356,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_security_rules_operations.py index 295e52f0c21e1..565dad1380104 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_association_links_operations.py index 5af831d6bf177..c572d162a5a6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policies_operations.py index e6f7e95b5889c..7469f7f5ad6e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -290,7 +296,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -408,7 +420,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -450,7 +468,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -458,7 +476,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,7 +535,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -527,7 +545,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 4aec6fda73715..1515863fbea8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -136,7 +136,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -361,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_tags_operations.py index f88e2e8043764..76aba51ed5de2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_subnets_operations.py index f5fd5f39d6f8c..a48682fb728a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,7 +163,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -221,10 +228,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -304,7 +311,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -399,7 +413,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -447,7 +461,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -466,7 +487,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -516,7 +537,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -564,7 +585,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -583,7 +611,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -595,7 +623,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_usages_operations.py index 3c3b35b124b24..06349f2f43fc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_hubs_operations.py index 9732068bafa44..39e118ebcbe6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,10 +233,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -284,9 +290,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -306,7 +312,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateway_connections_operations.py index 0bfdd1b729fcd..a982dd1b57009 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +319,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -331,10 +343,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -386,9 +398,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -409,7 +421,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -434,7 +446,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -452,10 +470,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -509,9 +527,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -534,7 +552,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -559,7 +577,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -578,7 +602,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -592,7 +616,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -637,7 +661,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -648,7 +672,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -708,10 +732,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,9 +787,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -789,7 +813,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -814,7 +838,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -832,7 +862,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -874,7 +904,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -891,7 +921,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -940,7 +970,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -958,7 +994,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -997,7 +1033,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1014,7 +1050,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1063,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateways_operations.py index 2378620c33ee8..524d019b32044 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -382,9 +394,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -404,7 +416,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -429,7 +441,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -447,7 +465,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -457,7 +475,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -530,7 +548,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,8 +611,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -645,7 +663,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -666,7 +684,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -691,7 +709,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -792,7 +816,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -810,7 +840,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -865,7 +895,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -914,7 +944,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -932,7 +968,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -987,7 +1023,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1036,7 +1072,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1147,7 +1189,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,8 +1215,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1219,7 +1267,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1239,7 +1287,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1264,7 +1312,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1341,8 +1395,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1390,7 +1444,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1409,7 +1463,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1433,7 +1487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1453,8 +1513,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1504,7 +1564,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1525,7 +1585,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1550,7 +1610,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1568,10 +1634,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1623,9 +1689,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1647,7 +1713,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1672,7 +1738,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1691,8 +1763,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1738,7 +1810,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1758,7 +1830,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1782,7 +1854,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1800,7 +1878,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1867,7 +1945,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1909,7 +1987,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1926,7 +2004,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1974,7 +2052,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1992,7 +2076,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2031,7 +2115,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2048,7 +2132,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2096,7 +2180,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2115,8 +2205,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2164,7 +2254,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2183,7 +2273,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2207,7 +2297,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_peerings_operations.py index 8d94161e6a6be..3ee9495dbb823 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -155,7 +162,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -169,7 +176,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,10 +223,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,9 +282,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -300,7 +307,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_taps_operations.py index 91c575e51eb33..59301b120b277 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -148,7 +154,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -160,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -205,10 +211,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,9 +268,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -284,7 +290,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -309,7 +315,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,10 +339,10 @@ async def _update_tags_initial( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,9 +392,9 @@ async def begin_update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -402,7 +414,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -427,7 +439,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -444,7 +462,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -452,7 +470,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,7 +529,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -521,7 +539,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_networks_operations.py index 3d157dab4b1b5..b61cf4bf441df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -129,7 +129,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -163,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,10 +216,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,9 +273,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -289,7 +295,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -314,7 +320,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,10 +344,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,9 +397,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -407,7 +419,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def get_long_running_output(pipeline_response): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +475,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -516,7 +534,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -526,7 +544,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +606,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -602,7 +620,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_08_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,7 +667,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -661,7 +679,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_router_peerings_operations.py index 8b1147aec1111..3f6cb02d7ffcd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,9 +227,9 @@ async def update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Updates a Virtual Router Peering. :param resource_group_name: The resource group name of the Virtual Router Peering. @@ -238,7 +245,7 @@ async def update( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,7 +282,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -291,10 +298,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -331,7 +338,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -421,7 +435,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -433,7 +447,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +494,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_routers_operations.py index 1324bb55ad1de..5818eeb665381 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,9 +220,9 @@ async def update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Updates a Virtual Router. :param resource_group_name: The resource group name of the Virtual Router. @@ -230,7 +236,7 @@ async def update( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -266,7 +272,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -281,10 +287,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -339,9 +345,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -361,7 +367,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -386,7 +392,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -404,7 +416,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -474,7 +486,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -482,7 +494,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +539,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_wans_operations.py index 1a777d6b69fe9..e0a979facb42c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,10 +233,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -284,9 +290,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -306,7 +312,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_connections_operations.py index 4e7b3f0e1d8da..c8285a3d8a702 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_gateways_operations.py index b124c84b602dd..bc77fd798d074 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,10 +234,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,9 +291,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -307,7 +313,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +338,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -434,7 +446,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -453,8 +471,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -502,7 +520,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -520,7 +538,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +562,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -562,7 +586,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -572,7 +596,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -631,7 +655,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -639,7 +663,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_link_connections_operations.py index 8749815e5e89b..5e6d81fee2d0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index d33ab1c716a1f..ada8e51620a97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_operations.py index 2611e49cb1b7f..acdcb1f9ce47b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,10 +236,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,9 +293,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -310,7 +316,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -437,7 +449,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -465,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_link_connections_operations.py index 0509371c9435d..67983fab6853f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_links_operations.py index bcec6b700a609..9ab8e0306fc5a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_configuration_operations.py index 903732ae9073a..a51e12a85baa8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_operations.py index 9059867504db6..eab59cb31db15 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,10 +233,10 @@ async def _update_tags_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -284,9 +290,9 @@ async def begin_update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -306,7 +312,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_web_application_firewall_policies_operations.py index 708afd2e38a67..35c382792c079 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_gateways_operations.py index a87b7baf32c86..8452b11eddfc0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -678,7 +696,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -780,7 +804,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -801,8 +831,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +884,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -874,7 +904,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -899,7 +929,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -917,12 +953,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -976,11 +1012,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -1003,7 +1039,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1029,7 +1065,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1084,7 +1126,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1136,7 +1178,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1188,7 +1230,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1203,7 +1245,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1211,7 +1253,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1296,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1262,7 +1304,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1305,7 +1347,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1313,7 +1355,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1373,7 +1415,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1383,7 +1425,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_security_groups_operations.py index d15b40f5c749e..a90393eff3bca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -465,7 +483,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +543,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_delegations_operations.py index 1ae2d9f68c9ba..6d3455e57a78f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_endpoint_services_operations.py index f199ae53a189b..8009d3de42441 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_private_endpoint_types_operations.py index 0aa0826918ef9..9a12450be2152 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_resource_group_delegations_operations.py index 75b0317f2834f..fa755b287642f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_service_aliases_operations.py index 39f2182e87edf..4e6b9fd7a7a6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewall_fqdn_tags_operations.py index 4ba279c65191d..06065811d3e02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewalls_operations.py index 6bfb9d4d39216..6b378d9ef5698 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,10 +348,10 @@ def update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Updates tags for an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -482,7 +494,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bastion_hosts_operations.py index 41e83afb6ebb6..cc2ac8f3dfc88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +348,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +416,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bgp_service_communities_operations.py index 81d2592587bd1..89f41e1eb8bf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_connection_monitors_operations.py index f9ed8ffdcf211..6771c872a5e57 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_custom_policies_operations.py index 2db5cdf6a8ae2..2def807f01314 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,11 +349,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +403,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -414,7 +426,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_protection_plans_operations.py index e8c679a4c84d1..13234b015a591 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_default_security_rules_operations.py index e20ead31ff933..7754d52ec3c49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_authorizations_operations.py index 3e1342e7c000c..3a8e11653ac27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_connections_operations.py index 0a490cf41c6d8..0f56d1ff5b396 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -148,7 +148,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,7 +178,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -186,7 +194,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,11 +243,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +305,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -325,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +360,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -373,7 +389,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -388,7 +404,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_peerings_operations.py index e99bf7e42f65d..6e7d13ecf03fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuits_operations.py index 60140eeef8700..3fafcde368217 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -460,8 +478,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -514,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -537,7 +555,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +581,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -585,8 +611,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +665,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -662,7 +688,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -688,7 +714,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -710,8 +744,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -764,7 +798,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -787,7 +821,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -813,7 +847,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -833,7 +875,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -845,7 +887,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -893,7 +935,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -907,7 +949,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +996,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -964,7 +1006,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1024,7 +1066,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1032,7 +1074,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_connections_operations.py index 1fede7c853cb0..a640cdfe16f3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connection_peerings_operations.py index 4004e96804685..5f236d997250a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,7 +244,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -251,7 +258,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -298,11 +305,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,10 +365,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -384,7 +391,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -410,7 +417,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connections_operations.py index 60fffb57f73f9..ceae4d1e768ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,11 +375,11 @@ def _update_tags_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def begin_update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -447,7 +453,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -472,7 +478,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -494,8 +506,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -548,7 +560,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -571,7 +583,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -597,7 +609,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -619,8 +639,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -696,7 +716,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -722,7 +742,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -744,8 +772,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -798,7 +826,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -821,7 +849,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_gateways_operations.py index 7a942d6690a5b..cced92a1b38f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_links_operations.py index 5b3616f3c341d..c9811255b5eea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_locations_operations.py index 389c89c04b0ef..6ca3f24a9084d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_operations.py index c4af97d395be7..6521f9f3dd718 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,7 +545,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -535,7 +553,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_service_providers_operations.py index 834ad33bdf3d6..873527b1c925f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policies_operations.py index a87e997ee4421..a266461580872 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def update_tags( self, resource_group_name, # type: str firewall_policy_name, # type: str - firewall_policy_parameters, # type: "models.TagsObject" + firewall_policy_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Updates a Firewall Policy Tags. :param resource_group_name: The resource group name of the Firewall Policy. @@ -234,7 +240,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +276,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FirewallPolicy', pipeline_response) @@ -285,11 +291,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,10 +349,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -366,7 +372,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policy_rule_groups_operations.py index ffd993bdfb465..5217ef74edb2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_hub_virtual_network_connections_operations.py index 8e1aec7e20509..b21dd647b2288 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_inbound_nat_rules_operations.py index 2e2332b7629d5..dc763d568b18a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -238,7 +245,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -254,7 +261,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,11 +310,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,10 +370,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -389,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +422,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_backend_address_pools_operations.py index 46af1c3c80e14..2ab10529b52b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 6610f4dac38e4..d17c8267a2187 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_load_balancing_rules_operations.py index b27d071817b8a..8055d8e4fd337 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_network_interfaces_operations.py index a3fd5663a762f..01415caaea60b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_outbound_rules_operations.py index 5fb4aaebc3802..593f3bba73ecc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_probes_operations.py index 02942ff8dea18..ebe8efecbec42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancers_operations.py index 5f143822296c4..cca1dce608bdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_local_network_gateways_operations.py index 81ef4523c6017..5f7f9db9962fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -457,7 +475,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_nat_gateways_operations.py index 91eb2d381b3ce..dd4e0a191199b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_ip_configurations_operations.py index d0715a87281de..5f17e6647d1ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_load_balancers_operations.py index 9c4c4de79a4ef..17c54d4350661 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_tap_configurations_operations.py index 35e7a000b643a..e40d39e4f6d05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interfaces_operations.py index e853f7a486541..0b2ff41586309 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,8 +619,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -651,7 +669,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -669,7 +687,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -713,8 +737,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -763,7 +787,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -781,7 +805,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -805,7 +829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +856,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -841,7 +871,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -905,7 +935,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -917,7 +947,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -983,7 +1013,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1001,7 +1031,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1055,7 +1085,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1073,7 +1103,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1174,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1164,7 +1194,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_management_client_operations.py index 75f6a947190ef..68f50de9821c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_management_client_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -32,7 +32,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -45,7 +45,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_08_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -105,7 +105,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,11 +150,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +206,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -232,7 +232,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -257,7 +257,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_profiles_operations.py index 5992861c9249b..839049d3d1a47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +223,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -234,7 +240,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +361,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -363,7 +369,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +429,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -433,7 +439,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_security_groups_operations.py index 983f61f90274c..f74682bbfa40e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py index a44ba3565b252..defd552d769b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_08_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1903,7 +1969,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1928,7 +1994,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_operations.py index 63a207dfecebc..dbce4cb611d75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_p2_svpn_gateways_operations.py index 1fd7969b0e952..71055a1d0883c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,11 +241,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -293,10 +299,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -317,7 +323,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +348,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -446,7 +458,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,7 +483,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -475,7 +493,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -535,7 +553,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -543,7 +561,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,11 +620,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,10 +676,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -682,7 +700,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -707,7 +725,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -727,8 +751,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,7 +801,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -796,7 +820,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -820,7 +844,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -838,11 +868,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -894,10 +924,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -918,7 +948,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -943,7 +973,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_packet_captures_operations.py index f56702e04b310..c757ce4bc8688 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_peer_express_route_circuit_connections_operations.py index bed726a31acbe..c17c0e1f8aac9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_endpoints_operations.py index b87c11de5e07f..6aaa58c62a19e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_link_services_operations.py index 0b971691877d3..f1166ef407473 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,10 +499,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -506,7 +518,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +555,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -594,7 +606,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -651,7 +663,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -668,11 +687,11 @@ def get_long_running_output(pipeline_response): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -722,10 +741,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -743,7 +762,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -767,7 +786,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -785,11 +809,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -841,10 +865,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -865,7 +889,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -890,7 +914,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -909,7 +939,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -920,7 +950,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -982,7 +1012,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -995,7 +1025,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_addresses_operations.py index 20e18baf6a4b8..4e5713b9c84f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +619,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -679,7 +697,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -698,7 +716,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -769,7 +787,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -791,7 +809,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_prefixes_operations.py index 2eef281c8bd28..e2d19f6273ec6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_resource_navigation_links_operations.py index 2944b495e58af..da2eefd203564 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filter_rules_operations.py index ae29c8d07d527..5c6d2f792a6d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,11 +368,11 @@ def _update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,10 +424,10 @@ def begin_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" + route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -436,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,7 +503,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filters_operations.py index 748a9fe68c18a..1d6aa4971e3cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.PatchRouteFilter" + route_filter_parameters, # type: "_models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_tables_operations.py index 8e10fd18c1dff..093e6f8bc69ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +490,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_routes_operations.py index 0eee7f43ffe5b..332f321f82f70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -308,7 +315,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +341,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -354,7 +368,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -366,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_security_rules_operations.py index 7afa0378525f5..1b539334ce49f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_association_links_operations.py index a1e73bb75d3b6..c67421186cc0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policies_operations.py index 5466c17c2d243..4c359dbe7bd81 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -299,7 +305,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -419,7 +431,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -462,7 +480,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -470,7 +488,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -540,7 +558,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policy_definitions_operations.py index ea3b87824adf7..1561759a27dfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -142,7 +142,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -371,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_tags_operations.py index fd495034c96df..25b225fcd569f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_subnets_operations.py index 881204c9ece5f..94e87783e0015 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -163,7 +170,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,11 +235,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -313,7 +320,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,7 +372,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -409,7 +423,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -477,7 +498,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -528,7 +549,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -577,7 +598,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -597,7 +625,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -609,7 +637,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_usages_operations.py index 385a207f1a289..5e493f22acf82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_hubs_operations.py index d28b8d52b08f4..032d4dba74d61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,11 +240,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +298,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -315,7 +321,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +346,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateway_connections_operations.py index f821311acdba4..91d7a365c9a2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +328,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,11 +352,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,10 +408,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -420,7 +432,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,11 +481,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -521,10 +539,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -547,7 +565,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -572,7 +590,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -592,7 +616,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -606,7 +630,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -652,7 +676,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -663,7 +687,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -723,11 +747,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,10 +803,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -806,7 +830,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -831,7 +855,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -849,7 +879,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -892,7 +922,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -909,7 +939,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -959,7 +989,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -977,7 +1013,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1017,7 +1053,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1034,7 +1070,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1084,7 +1120,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateways_operations.py index b5dab22367985..3e2d2afc954b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -392,10 +404,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -440,7 +452,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,7 +477,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -469,7 +487,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -543,7 +561,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -607,8 +625,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -660,7 +678,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -681,7 +699,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -706,7 +724,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -809,7 +833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -827,7 +857,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -883,7 +913,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -933,7 +963,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -951,7 +987,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1007,7 +1043,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1057,7 +1093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1170,7 +1212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1191,8 +1239,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1244,7 +1292,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1264,7 +1312,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1289,7 +1337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1368,8 +1422,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1418,7 +1472,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1437,7 +1491,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1461,7 +1515,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1482,8 +1542,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1534,7 +1594,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1555,7 +1615,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1580,7 +1640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1598,11 +1664,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1654,10 +1720,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1679,7 +1745,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1704,7 +1770,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1724,8 +1796,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1772,7 +1844,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1792,7 +1864,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1816,7 +1888,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1834,7 +1912,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1902,7 +1980,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1945,7 +2023,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1962,7 +2040,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2011,7 +2089,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2029,7 +2113,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2069,7 +2153,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2086,7 +2170,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2135,7 +2219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2155,8 +2245,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2205,7 +2295,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2224,7 +2314,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2248,7 +2338,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_peerings_operations.py index b4ebce7eab378..b8e13304c4e93 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,7 +169,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -176,7 +183,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,11 +230,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,10 +290,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -309,7 +316,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_taps_operations.py index 108618f34e1fa..0fa041a9364ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -155,7 +161,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -167,7 +173,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,11 +218,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,10 +276,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -293,7 +299,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -318,7 +324,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,11 +348,11 @@ def _update_tags_initial( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -390,10 +402,10 @@ def begin_update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -413,7 +425,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -438,7 +450,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -456,7 +474,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -464,7 +482,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +542,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -534,7 +552,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_networks_operations.py index 9e4bdcc3da396..1ebfeb7747ce0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -135,7 +135,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -170,7 +176,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,11 +223,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,10 +281,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -323,7 +329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -341,11 +353,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,10 +407,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -418,7 +430,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -469,7 +487,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +547,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,7 +620,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -616,7 +634,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_08_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -664,7 +682,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -676,7 +694,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_router_peerings_operations.py index afbb7116e2c59..ee64c7330679e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,10 +234,10 @@ def update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Updates a Virtual Router Peering. :param resource_group_name: The resource group name of the Virtual Router Peering. @@ -246,7 +253,7 @@ def update( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +290,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -299,11 +306,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -340,7 +347,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -432,7 +446,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -444,7 +458,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -491,7 +505,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_routers_operations.py index 5de125c425092..aba5804becaa3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,10 +227,10 @@ def update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Updates a Virtual Router. :param resource_group_name: The resource group name of the Virtual Router. @@ -238,7 +244,7 @@ def update( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -274,7 +280,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -289,11 +295,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -329,7 +335,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -348,10 +354,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -371,7 +377,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -396,7 +402,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -415,7 +427,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -425,7 +437,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -486,7 +498,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -494,7 +506,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +551,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_wans_operations.py index 4f90cd53e066f..c7457a1b921a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,11 +240,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +298,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -315,7 +321,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +346,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_connections_operations.py index 592e719589640..f72b86570c333 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_gateways_operations.py index 22ab7578087f1..6de453afe7af6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,11 +241,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -293,10 +299,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -316,7 +322,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +347,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,8 +483,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -515,7 +533,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -533,7 +551,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -557,7 +575,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +600,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -586,7 +610,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +670,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -654,7 +678,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_link_connections_operations.py index 2803669482348..cb535827f1c22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 845897385dc1a..9bc21c29d2d23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_operations.py index a40454bdad0ee..443b6f7a29a38 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,11 +243,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,10 +301,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -319,7 +325,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -448,7 +460,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +555,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_link_connections_operations.py index d9082fa22710f..1d1441bf0ef0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_links_operations.py index ad2abe6037e62..524cb36962713 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_configuration_operations.py index 610143c83cca5..03efc4c8d51d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_operations.py index 879489c1f903d..2d3666ce156d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,11 +240,11 @@ def _update_tags_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +298,10 @@ def begin_update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -315,7 +321,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +346,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_web_application_firewall_policies_operations.py index 80ce8dda3bd45..cf286477584a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_08_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_metadata.json index b69aba4174880..780b7b7920a64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -143,60 +144,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -208,7 +209,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -220,19 +221,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2019_09_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2019_09_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -244,7 +245,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -256,31 +257,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_09_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_09_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_09_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_09_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_network_management_client.py index 276a922170b29..a201cef510989 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/_network_management_client.py @@ -312,7 +312,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/_network_management_client.py index 9b6623da9f837..6872ac6c13bb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/_network_management_client.py @@ -309,7 +309,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_gateways_operations.py index 8c5a496ce3a93..573efa1e24c95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_security_groups_operations.py index a4e022aed8b50..7f3d5376d4e7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_delegations_operations.py index fe78e38528b03..bd2bf8447cbcc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_endpoint_services_operations.py index d4ecb011c950e..92a77fd516ae1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_private_endpoint_types_operations.py index aa00a9c2eafb6..f8485cca92134 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_resource_group_delegations_operations.py index 38584ba3a84e1..469b5d1d8f3b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_service_aliases_operations.py index 5307b8a107f1d..a23a959c35a77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 2a9ee6dd7a76b..d9671d5d680f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewalls_operations.py index 0e5e2e10c8b1f..ce7bf9e6e32d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.AzureFirewall"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + ) -> Optional["_models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -526,7 +544,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bastion_hosts_operations.py index cd95a6284eae9..874100fdea274 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bgp_service_communities_operations.py index 209992c2e0a19..2c9092fa343c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_connection_monitors_operations.py index 93318d778aab0..3017579e2cd02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_custom_policies_operations.py index 747dd63d88ba6..4f207209f31b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_protection_plans_operations.py index af1ebb87b5c2a..f255f41bcd265 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_default_security_rules_operations.py index 46d1e1c7e1d5a..497ad021ab330 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_authorizations_operations.py index d2a231d343bb6..a551cd58311f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_connections_operations.py index a5a8d6ae2bedf..52e2a54f68374 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_peerings_operations.py index 8810b22475c27..ebe59446ce407 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuits_operations.py index 67f45e1a99837..cf72fbd5ab4f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_connections_operations.py index 26d535fea8ddf..5e9796438d9d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 38e15c8c46d58..416c880afb4cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connections_operations.py index aca31752d31c3..60d6daff81e28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_gateways_operations.py index 6027eb2f8911e..3c8cc88d437c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_links_operations.py index 2e22225627532..a6197ad5a56e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_locations_operations.py index 9635fe432c6f1..a48b77e9b3d3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_operations.py index a04fb9f9dffa4..fdb7bd3ff7dc1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_service_providers_operations.py index 629d29fba4767..a25373e797e07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policies_operations.py index 3163024439c41..fa687eeb10d09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policy_rule_groups_operations.py index 307f3d903aa2e..d9f56f566ea24 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_hub_virtual_network_connections_operations.py index 53cfb1dd351f6..994c099905f9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_inbound_nat_rules_operations.py index 9a789044534a3..e56705f11ec04 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ip_groups_operations.py index 80c02c99bbc3e..bcfee9c94e598 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2019_09_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 54a9b76f1ebf7..f0a45e12a5c86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index e3b24e15119b1..4de6116cc2712 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index b2318a78635fe..498bec899613c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_network_interfaces_operations.py index e2d8f79fda338..be0429ebdd83a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_outbound_rules_operations.py index dbf52a86c1346..56c5849d67c7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_probes_operations.py index f081120fb21b3..3c6e67e65aca1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancers_operations.py index 52a1e67038c86..c9bbe239339db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_local_network_gateways_operations.py index 620bf30583658..5bb5da8766194 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_nat_gateways_operations.py index 5f56799198044..2c7f85b981415 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +349,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +491,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_ip_configurations_operations.py index e6c7c4d60d582..8fdaaa9d1627c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_load_balancers_operations.py index 7d6641404f7b2..b973e1740f6b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_tap_configurations_operations.py index ff33ef6315250..d28634d7e50ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interfaces_operations.py index 0800cc1aea913..4361aebd5569b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_management_client_operations.py index d437917a3302d..ac2a2d8bced9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_09_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_profiles_operations.py index 5843646b1dfe0..41be4d4d67f73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_security_groups_operations.py index efe3438712785..5efb9a1e89211 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_watchers_operations.py index 770f454f99018..fda4dcca6c8d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_09_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1619,7 +1673,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1644,7 +1698,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1662,10 +1722,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1701,7 +1761,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1720,9 +1780,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1742,7 +1802,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1767,7 +1827,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1785,10 +1851,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1824,7 +1890,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1843,9 +1909,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1869,7 +1935,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1894,7 +1960,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_operations.py index 98fe051243446..07802f1ce9948 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_p2_svpn_gateways_operations.py index 708528a96617d..34774ed446b7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -245,7 +251,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -379,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -407,7 +419,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +486,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,10 +545,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,9 +600,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -636,7 +648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +673,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -723,7 +741,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,10 +789,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,9 +844,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -843,7 +867,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -868,7 +892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_packet_captures_operations.py index 10a637156281d..09c87c011b898 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_peer_express_route_circuit_connections_operations.py index ba6945606e317..b25f83eaa4c1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_endpoints_operations.py index cff3ee76ac98b..e1880f63694e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_link_services_operations.py index 16620b18ea946..5669f60a0d902 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_addresses_operations.py index b72410413f616..5392ec1236c78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_prefixes_operations.py index dc09482ae95d7..9d3a19be218b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_resource_navigation_links_operations.py index 48238dffb3c6f..07a79eec7d5fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filter_rules_operations.py index 4efc803e3b000..d866924093a9a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filters_operations.py index 9c27733386eb4..5f3092f0cb96f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_tables_operations.py index 9bd223ad59a85..72e857891ddd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_routes_operations.py index 8d82f2856fe19..c0946d8a92d74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_security_rules_operations.py index 762133653fece..47254e070126b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_association_links_operations.py index 266a1bc0fc539..aef8215ee5955 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policies_operations.py index 8e7e148d1fc3d..5b5a2fe637ba7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policy_definitions_operations.py index ac13dc01f254b..a7c8144df6323 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_tags_operations.py index 96bdfa4007d63..e645e0ce470e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_subnets_operations.py index 6b1caad7c1a52..54361d14e0724 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_usages_operations.py index 8a23d4a1cc01a..03030f353d176 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index 11ba005946f22..3ea2df67a94f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hubs_operations.py index 35605d39710f6..17d08e03b2cb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateway_connections_operations.py index 07aa87fc80499..8b9c118283dd9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateways_operations.py index 24e68062da7bd..3ed8bf284c30f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_peerings_operations.py index 70a8c3923cc9d..099215c51550f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_taps_operations.py index 5fc6b7f808aa3..9960ab780ebaa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_networks_operations.py index 6c539885f0c7c..1e1cc99ad752f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_09_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_router_peerings_operations.py index f9d3e061abbe6..3705215dd1b96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_routers_operations.py index 35ba6fdc70a91..6f1d807bcddf1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_wans_operations.py index 472c631419be1..17f47438e1ea7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_connections_operations.py index ba2d408c21126..5f3f11ab0cb90 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_gateways_operations.py index 3c196634fdecb..929d0e9db3a19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -244,7 +250,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +384,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,8 +409,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +458,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,7 +476,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -488,7 +500,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -506,7 +524,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -516,7 +534,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +593,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +601,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_link_connections_operations.py index 7b5bce4323c67..6c9a7bf010194 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index d007ede40e446..7e10fd335dcea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_operations.py index 67b44d0995c25..c09cf6f28c4d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_link_connections_operations.py index ed5558456cdc5..99f4f960b4b26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_links_operations.py index 94f0d65223785..da95ed5bbeea3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_configuration_operations.py index 36188be2e0f56..3da79e342ff36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_operations.py index 0b90199484ebc..a52bb967bc5b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_web_application_firewall_policies_operations.py index 8ad7188d73434..1ef4c9d4f88f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_gateways_operations.py index d950ea5f1d630..becfe8bb311b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_security_groups_operations.py index 2280b99146eb0..9d83a8e751b9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_delegations_operations.py index dd4a600cbc4fd..f472ec1424d11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_endpoint_services_operations.py index a604ee8040c3b..9de4e0e3151d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_private_endpoint_types_operations.py index b242a1638e57a..b86a9f49860e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_resource_group_delegations_operations.py index 29f86a822ca11..a6942ecacfb01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_service_aliases_operations.py index 97a689e68ca5b..9927cdda92d48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewall_fqdn_tags_operations.py index 1562c131c8028..31992070454e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewalls_operations.py index 7197d49a51554..7e1d685aa123b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.AzureFirewall"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + # type: (...) -> Optional["_models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -539,7 +557,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bastion_hosts_operations.py index da0ca738227dc..492e83351a845 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bgp_service_communities_operations.py index d0799c57bec05..1925a39a36d28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_connection_monitors_operations.py index 24e2dca1d5fa7..22231ee3d2caf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_custom_policies_operations.py index 7329ef9c09eab..f06b2e6527791 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_protection_plans_operations.py index 5bdb776b581a7..a657979beae4f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_default_security_rules_operations.py index e19b5ef6045ea..17a81ec0c3776 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_authorizations_operations.py index ddc55c6b2dcb2..fe033b9a3a01e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_connections_operations.py index 80b5e6abe8795..ca1d508a4850a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_peerings_operations.py index df2e2e9fe9884..c443b2d63ccdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuits_operations.py index 6661f34f6aac3..3431116bd0fd5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_connections_operations.py index a99a041300bcd..b438f43bc0be0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connection_peerings_operations.py index 492d79959497c..167d99ec5cf42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connections_operations.py index ed3422b03f512..43a2add7b15cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_gateways_operations.py index 53b934e3dc5ea..191b5256d1fe1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_links_operations.py index 8536fac22d0ac..7cf15157ff08c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_locations_operations.py index 1256872c505c2..c978ba01fc1b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_operations.py index e6f2e1e56afd6..5cb89375b7647 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_service_providers_operations.py index 321b6c9137082..9c2d53cf85b99 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policies_operations.py index 5b31dd5aa1300..e86a03201f59e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policy_rule_groups_operations.py index fafc7460e63a1..b68950addab0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_hub_virtual_network_connections_operations.py index 8209de7da1e0b..47fac059b4751 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_inbound_nat_rules_operations.py index be63ad81adbbe..deb843b62f144 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ip_groups_operations.py index 5b8225dacdbf7..9e4a837ff3bc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2019_09_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_backend_address_pools_operations.py index 93aa4322cfb8d..22cbfb57d5768 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 322c3d97c93e7..09693429e5846 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_load_balancing_rules_operations.py index c5bf4ee62f281..0dde034e5f291 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_network_interfaces_operations.py index d2e0562788d42..f94da456c2384 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_outbound_rules_operations.py index 66b481c73f7b7..b11f2a9b1d382 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_probes_operations.py index e7ec692a07e76..ace1ba454d01e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancers_operations.py index 1f116c812c797..406b8fe4f7f79 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_local_network_gateways_operations.py index 687c97341bd74..61d66c277caa5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_nat_gateways_operations.py index 922fe0e5ce02a..809e070a5da67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +358,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +375,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_ip_configurations_operations.py index b2428dc4df26a..2991009a30a4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_load_balancers_operations.py index bdd3dbf08bbe4..dac47e993873a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_tap_configurations_operations.py index dc15662ad4e9c..433435c1000dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interfaces_operations.py index 2d9c25015aab4..622523ca56d66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_management_client_operations.py index 466a8f9b90809..89bef24a9bba6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_09_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_profiles_operations.py index 956868d25af7a..0d771cc3d3429 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_security_groups_operations.py index 7e93b187907f3..b1e7f02c62889 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_watchers_operations.py index bcdb46a303e2c..a604b8761aa2c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_09_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1649,7 +1703,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1674,7 +1728,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1692,11 +1752,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1732,7 +1792,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1751,10 +1811,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """Lists all available internet service providers for a specified Azure region. :param resource_group_name: The name of the network watcher resource group. @@ -1774,7 +1834,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1799,7 +1859,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1817,11 +1883,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1857,7 +1923,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1876,10 +1942,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1903,7 +1969,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1928,7 +1994,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_operations.py index 0c19d6c75f1cd..b32b313e78162 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py index cd2295d8d4c9d..3dbdc0aba2291 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -253,7 +259,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -389,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,7 +420,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,7 +430,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +498,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,11 +557,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,10 +613,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -650,7 +662,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -670,8 +688,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -739,7 +757,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -781,11 +805,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,10 +861,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -861,7 +885,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -886,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_packet_captures_operations.py index 9e63154913f4c..2fb999b7fbfb6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_peer_express_route_circuit_connections_operations.py index 106ce13b2b728..8e8e78d6469e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_endpoints_operations.py index a83beb945c8ef..27147731e1d28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_link_services_operations.py index 9b0d34705e544..ef36510de2ab1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_addresses_operations.py index e45245dec7e0f..c5ccbc49b9ebc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_prefixes_operations.py index 8e92118b4102b..c380af3b455e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_resource_navigation_links_operations.py index 85a7642099d52..b559221105420 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filter_rules_operations.py index 35309a8d6bb95..2dab7febc34a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filters_operations.py index 83363ba11b80b..7c9670482c2f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_tables_operations.py index db1a0382c48d2..21f7578f06a42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_routes_operations.py index d5a5bd2bedc40..83773009f6be5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_security_rules_operations.py index e20509237fbfc..4d61465f90d6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_association_links_operations.py index bc8c9b2c16b9c..b135f41fbcaa8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policies_operations.py index 0bac0cc060d5d..818fdbcc47225 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policy_definitions_operations.py index 4c2a2a1634992..e09afaa86d855 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_tags_operations.py index 0d6a1a05e4a6c..d275e5c3de7c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_subnets_operations.py index c4005070bbac4..35288d83dda92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_usages_operations.py index 28310a4d39572..be269a946df45 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hub_route_table_v2_s_operations.py index d1103249c4ef5..96a7ea39306c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hubs_operations.py index ff1709b7cf409..7206a9fd173fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateway_connections_operations.py index b07b897e6d171..43100c0f81608 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateways_operations.py index de3376177cd1a..747c9200e62c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_peerings_operations.py index 9304c9913fa1a..b8c172c055c98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_taps_operations.py index a10875dd83707..f234858cb196d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_networks_operations.py index 85f91f459ae3a..add2a4cbcc2c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_09_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_router_peerings_operations.py index 3977cfc9b260d..9605158e745de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_routers_operations.py index e66fd7b493b0c..1af05d011363d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_wans_operations.py index e324b5abc7d5d..6d6f54493decc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_connections_operations.py index 5e1f14e902b55..a8936cbbbeeb9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_gateways_operations.py index 496b1d75c72a9..00aa2cdeb4758 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -252,7 +258,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,7 +394,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,8 +420,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,7 +470,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -476,7 +488,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -519,7 +537,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -529,7 +547,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +607,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -597,7 +615,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_link_connections_operations.py index 1f82d94251e3c..c19a5ee5493e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 647bbbf35be9c..b29e24dbe8bc1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_operations.py index ec3df2269dae7..9a24f287547aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_link_connections_operations.py index a3cf599f626af..6e7a9113ebf43 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_links_operations.py index 67c01c35f3370..55fa208b28ace 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_configuration_operations.py index 2bdd25a8142eb..8b88006bf47d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_operations.py index 84135134ed56a..ed9bf63c65fc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_web_application_firewall_policies_operations.py index bb039a2502f20..754135ce9a292 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_09_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_metadata.json index 91347a2a4fde6..0b87a2033729f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -144,60 +145,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -209,7 +210,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -221,19 +222,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2019_11_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2019_11_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -245,7 +246,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -257,31 +258,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_11_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_11_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_11_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_11_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_network_management_client.py index fd296c00ff0a0..29aa1afc27ba7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/_network_management_client.py @@ -315,7 +315,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/_network_management_client.py index 52971d5b9b863..cb2f088927884 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/_network_management_client.py @@ -312,7 +312,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_gateways_operations.py index 228397ec52ee2..168a68aeaada9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_security_groups_operations.py index 003beb24095c5..f83474511d2f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_delegations_operations.py index b3b2d119ac7d0..23d58a01b41c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_endpoint_services_operations.py index 72d8fda39c367..12affe6f282c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_private_endpoint_types_operations.py index c7fdd8299fe7d..a2f7e53dfd0ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_resource_group_delegations_operations.py index a19d5e0252dcb..27bd359b0523c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_service_aliases_operations.py index 06b2c055a577b..addf9ebfdbd0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index a82b380fc44d5..ca1268266eb9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewalls_operations.py index a26bf5d24195c..c12f9a1c151d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bastion_hosts_operations.py index 5ad384f408e13..c4296be4eb12c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bgp_service_communities_operations.py index 6ff81e808c9ed..e6e70172a13bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_connection_monitors_operations.py index 283853f21278e..36a0b3f47ec85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_custom_policies_operations.py index 2899928866cf0..5fa891944ae25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_protection_plans_operations.py index 084d1994b2c2f..0180d92e0cb64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_default_security_rules_operations.py index 815a9743f2ada..5c23fff30eb6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_authorizations_operations.py index 192b569a2b315..5d725ee4aadb4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_connections_operations.py index 71a6a8d9350a8..7309722f0d449 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_peerings_operations.py index d96ee56a1e93f..3645f1c358c64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuits_operations.py index b22dd02631bfb..f13e914ccd5a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_connections_operations.py index 10ec1a6623ef3..8690ed30d8a3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 5542101c38d62..9cb22a08e5b1d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connections_operations.py index 5b0894657b8f8..7e9619fa73e35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_gateways_operations.py index cfd4f73f8cb20..23a11ac9d7786 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_links_operations.py index 2c77d534ca9e4..b3c148aa4af49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_locations_operations.py index ed6977926d0db..18de3912d9dcb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_operations.py index 18d36bef1edd3..74dc719cb0e2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_service_providers_operations.py index 8fa3648b8de24..562620df96ed6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policies_operations.py index 03c3da5f3b918..8508ab064cc62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policy_rule_groups_operations.py index 78e5eff1c2966..69cbd1d772abe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_flow_logs_operations.py index 807b9d11fe9f0..c8d457cfe793e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FlowLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> "models.FlowLog": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> AsyncLROPoller["models.FlowLog"]: + ) -> AsyncLROPoller["_models.FlowLog"]: """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.FlowLogListResult"]: + ) -> AsyncIterable["_models.FlowLogListResult"]: """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -408,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_hub_virtual_network_connections_operations.py index 000c1b159c6a3..dbdb01ae91411 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_inbound_nat_rules_operations.py index 7342a3d3b586b..51cc16fdffe94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ip_groups_operations.py index 2d189190c6c17..a55f4c4aa6214 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2019_11_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py index d49e59501514a..63f7615be10d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 8cf2c22d04148..6102f5792eca6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index eefab70054fca..cfb97cc9a8185 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_network_interfaces_operations.py index 433e1097609ea..c2b2c1468274b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_outbound_rules_operations.py index bde6353386c29..4b3e440bc18de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_probes_operations.py index 33b1059dc3d6d..3172a2c260825 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancers_operations.py index 5c620742c461d..137449fe3dea2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_local_network_gateways_operations.py index d9a03815de0a0..ab96973f0e482 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_nat_gateways_operations.py index 83e0a3fa25fc8..f935969d033a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +349,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +491,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_ip_configurations_operations.py index f93704a6fff8f..fb46f251d927a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_load_balancers_operations.py index 66157d2e2bf60..bd74cb8e0a48d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_tap_configurations_operations.py index 94e3e2e27cc39..ae78ba8a85212 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py index b0689b71e78ff..f55bb80d82b25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_management_client_operations.py index c0e6c67aeb631..b6245743996a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_11_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_profiles_operations.py index 93768ed6832da..46f1d4a008b98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_security_groups_operations.py index 247b50e3c09ff..11a4093dafb92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_watchers_operations.py index cb8222f8250a5..0fe88ac833a11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_11_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1620,7 +1674,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1699,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1663,10 +1723,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1702,7 +1762,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1721,9 +1781,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1744,7 +1804,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1769,7 +1829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1787,10 +1853,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1826,7 +1892,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1845,9 +1911,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1871,7 +1937,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_operations.py index 34b4df4690ddc..5a495f06dc4ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_p2_svpn_gateways_operations.py index b98425ecc723d..1cdcffed94b78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -245,7 +251,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -379,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -407,7 +419,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +486,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,10 +545,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,9 +600,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -636,7 +648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +673,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -723,7 +741,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,10 +789,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,9 +844,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -843,7 +867,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -868,7 +892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -886,7 +916,7 @@ async def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -936,7 +966,7 @@ async def begin_disconnect_p2_s_vpn_connections( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource @@ -981,7 +1011,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_packet_captures_operations.py index 53b08de99cdac..ddd2514a052cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_peer_express_route_circuit_connections_operations.py index b2b8908f07f9a..06aa59e324ed9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_endpoints_operations.py index ede2b80045d83..e7de52a216698 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_link_services_operations.py index c2b85eaf62c66..a6fbc81ec4871 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_addresses_operations.py index 09494611ea939..2b0fc79b4b7a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_prefixes_operations.py index a6d8703867e37..5a0d0b21d46b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_resource_navigation_links_operations.py index 7f26ccb0b2371..4e4d75298fdef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filter_rules_operations.py index 8ca7572cf9c55..c62ad7b820c05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filters_operations.py index 2a77c3be72f41..73578e5074709 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_tables_operations.py index adc44f5b31718..7bfaabba8021a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_routes_operations.py index ba7a1c7fd13e8..eca1edf06e858 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_security_rules_operations.py index f1a4ed3494834..99ae252149ff5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_association_links_operations.py index 79359a4c3f876..3f86c2e3e0691 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policies_operations.py index 9ed8939d9c861..8861447fd86fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 053d3a722bf19..e4a964039c39f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_tags_operations.py index b5a6a3863a5ee..58c19be8ecc8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_subnets_operations.py index 5284e30f93243..67708769b5a98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py index edb822c68d5d2..2288f234bc3b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index 54fa5c2ad0906..d9e49d83b24a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hubs_operations.py index 67766a6ee1ecd..76e05c32172c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateway_connections_operations.py index c832b10880c12..4322dba8adf9a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateways_operations.py index 155df757b978f..1fb8e19f01363 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2229,7 +2325,7 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2279,7 +2375,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. @@ -2323,7 +2419,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_peerings_operations.py index 4f342331e9922..4e703334450e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_taps_operations.py index 3471c436faa3d..c57f06acfb21a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_networks_operations.py index cb19eac0f9058..1f89d73eda474 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_11_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_router_peerings_operations.py index 18a270ec24714..8c453188e54e5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_routers_operations.py index c477d8bd6ae9d..1811b972985ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_wans_operations.py index 0b29354077f7b..24213131eb784 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_connections_operations.py index 92fc5f07b9a56..dd42313de5518 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_gateways_operations.py index 25b2ad749aab3..c019d1748dbe4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -244,7 +250,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +384,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,8 +409,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +458,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,7 +476,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -488,7 +500,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -506,7 +524,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -516,7 +534,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +593,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +601,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_link_connections_operations.py index 0ebf34c7d2965..ab3c4cdd82ba6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index e64f80ea60e2c..d79b9e53db210 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_operations.py index 4adcfa2b4557d..a6d667e96610b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_link_connections_operations.py index c2279aaf41dcc..48c64f45bcbd6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_links_operations.py index 5f3cdd0d9f89d..bfb5ef01657c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_configuration_operations.py index ebe499fbd6055..7cdad9c8105da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_operations.py index 214adff6f1857..4c246222deddb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_web_application_firewall_policies_operations.py index 8ce03f64a2c3f..ee717bbfd5029 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_gateways_operations.py index d431b595774df..ffe9de58a22d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_security_groups_operations.py index a27f55c85ebcf..902075cd89fe7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_delegations_operations.py index 81155c939ae11..ffec33edacb36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_endpoint_services_operations.py index 7a2198a3db1e6..af326e418d99b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_private_endpoint_types_operations.py index 52f6a171a9752..1e0f855796ffd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_resource_group_delegations_operations.py index c47ba55223a25..42af415236976 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_service_aliases_operations.py index 00f5edb507583..a6e7b01b654c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewall_fqdn_tags_operations.py index 6177143011453..4b361d673b8f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewalls_operations.py index d70636e226312..5f9c4fcaf2b3d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bastion_hosts_operations.py index 0e28b1add39a0..d5687ba3a7dd5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bgp_service_communities_operations.py index 1b6bbb5866819..4f9503ff47b8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_connection_monitors_operations.py index 786d922e15565..6d65ba3d91fc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_custom_policies_operations.py index bfcf6a60a6970..a8f6be511af72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_protection_plans_operations.py index 1827a6d833696..26339e6e3fa8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_default_security_rules_operations.py index 348436828efa5..2cafc0edb22fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_authorizations_operations.py index 1f62d53ee3811..852d9d7a64ede 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_connections_operations.py index c853c3f92e961..e83c9893d51d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_peerings_operations.py index f9b93207632ea..badb6da475019 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuits_operations.py index 0f63b469ed1fb..3680dd5285a26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_connections_operations.py index 16b64be31d30b..f5cf0f257389e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connection_peerings_operations.py index 18a010b488f64..960ec01d6ce06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connections_operations.py index 7858618e42680..c9d7ddd576ee5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_gateways_operations.py index fe239beaa5c02..00fc35d09769f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_links_operations.py index b665872e695a0..a104216b8e987 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_locations_operations.py index 2a1b1535ff911..ddd731b88849a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_operations.py index 06aa1f7957542..ea7137a3bee93 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_service_providers_operations.py index 11d69c4800139..d5e5f41e209d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policies_operations.py index 604a262b60497..c196a024ce0a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policy_rule_groups_operations.py index 888d4147bd7f0..f08fd9a0051a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_flow_logs_operations.py index f22620bda8a46..b5db0f511f3b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FlowLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLog"] + # type: (...) -> LROPoller["_models.FlowLog"] """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FlowLogListResult"] + # type: (...) -> Iterable["_models.FlowLogListResult"] """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_hub_virtual_network_connections_operations.py index d3cf142041c90..5228e97d1fd2d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_inbound_nat_rules_operations.py index 2bbebc19c16db..56442ca053ce5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ip_groups_operations.py index 85ba41154f55e..81b6018d420e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2019_11_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_backend_address_pools_operations.py index 1fe521039a17e..26f2cda01e92b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 0150ea1aa65b5..dcfec8c53921a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_load_balancing_rules_operations.py index bb33d90ed85f8..dc19eddd4a2c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_network_interfaces_operations.py index 2ceec441f5566..c32c4bb9f1769 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_outbound_rules_operations.py index 8abeae641db43..b7f4e4b08f07d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_probes_operations.py index 9424b37306102..320c50fca8938 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancers_operations.py index 3a51edbc5ce0d..3b44f80f790f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_local_network_gateways_operations.py index c0ca428c958bd..52ec414b9fbda 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_nat_gateways_operations.py index aa529dba75dd1..ba030f583196b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +358,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +375,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_ip_configurations_operations.py index 2375960ff63fa..b36a431e22d01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_load_balancers_operations.py index 0b2471db08ef5..436bbf2227380 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_tap_configurations_operations.py index 758b23bee3795..7623f5b26f28d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interfaces_operations.py index d99f8e833af94..bc1d1748d1d3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_management_client_operations.py index a4757cc5a7b78..736318e2a8356 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_11_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_profiles_operations.py index 40eb525857fcc..cb780eda34363 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_security_groups_operations.py index ce9c38dbd6b3d..a39d12ca75b8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_watchers_operations.py index 43f45f8db0858..c90e4d6b5db2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_11_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1650,7 +1704,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1675,7 +1729,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1693,11 +1753,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1733,7 +1793,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1752,10 +1812,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1776,7 +1836,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1801,7 +1861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1819,11 +1885,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1859,7 +1925,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1878,10 +1944,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1905,7 +1971,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1930,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_operations.py index 301bc611fda60..b899c0673a121 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_p2_svpn_gateways_operations.py index 320d8cfbfadfa..b445aa9618463 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -253,7 +259,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -389,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,7 +420,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,7 +430,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +498,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,11 +557,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,10 +613,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -650,7 +662,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -670,8 +688,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -739,7 +757,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -781,11 +805,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,10 +861,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -861,7 +885,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -886,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -904,7 +934,7 @@ def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -955,7 +985,7 @@ def begin_disconnect_p2_s_vpn_connections( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1001,7 +1031,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_packet_captures_operations.py index bf9f27064e848..67f5c36db0c94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_peer_express_route_circuit_connections_operations.py index d366c0201246d..d5bb3737ed156 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_endpoints_operations.py index db8432a611b59..d76870145e7cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_link_services_operations.py index f1110c3dd958f..630a7b56feb23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_addresses_operations.py index e5e189cef561c..52a3fbae68c4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_prefixes_operations.py index b5f4f83bd95a7..88e31dabb8b8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_resource_navigation_links_operations.py index d586341cbd0a8..651bd2c49c592 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filter_rules_operations.py index d8ffbb66c094c..8c5d28a1455db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filters_operations.py index 08f49b9366b8d..e84e731b0eedc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_tables_operations.py index 5665096fdfead..5faf5dcaa1283 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_routes_operations.py index e7045e4a09b57..f10485894bfa3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_security_rules_operations.py index e8d8f8fc6050e..05e16399dc0ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_association_links_operations.py index 1b1a313ce8175..9ae6d19098ea4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policies_operations.py index 3bb832ba1b040..a9dba27768210 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policy_definitions_operations.py index ee1faa72757fd..58d45e226b238 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_tags_operations.py index d10d198e821d1..caed184b5a658 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_subnets_operations.py index 1e30de488dd05..ceec5b3f7e025 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_usages_operations.py index f1fa7938ee2fe..fe16a50686276 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hub_route_table_v2_s_operations.py index e1bbb2efea510..50c554a0b4753 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hubs_operations.py index 9e85145ca9b37..d8b686cea9f21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateway_connections_operations.py index 035663882b3e2..a07415fdc4b3f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateways_operations.py index 6e1a2e26491a1..4b148fe258b64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2270,7 +2366,7 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -2321,7 +2417,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2366,7 +2462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_peerings_operations.py index c1117861e3e2a..84223de3e2b42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_taps_operations.py index ac319e00f8f0f..d0a5022990511 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_networks_operations.py index 3e5b539162717..a01350214ead7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_11_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_router_peerings_operations.py index 87540a2b481c5..e48d141366e8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_routers_operations.py index 1b3475522332f..2c691383b2f00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_wans_operations.py index 7af75f6c09ea5..6cb3bf6f5baa7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_connections_operations.py index eba246dd7ea38..dbc82a04645c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_gateways_operations.py index 17fee8113985c..bf8adce09f17c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -252,7 +258,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,7 +394,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,8 +420,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,7 +470,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -476,7 +488,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -519,7 +537,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -529,7 +547,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +607,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -597,7 +615,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_link_connections_operations.py index d64474a9e1e9f..ea5c771de55d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index d0b1303d12c65..b3e3eb9985b11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_operations.py index a34bd1d6c69de..d165d14fc7ffa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_link_connections_operations.py index 692d040f967c8..2b54f7d206f15 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_links_operations.py index ebeedcf7be437..8c9077259feec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_configuration_operations.py index 18e9d8d34f567..e678a2f7d0beb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_operations.py index 5226798a42c3b..60b456dc88041 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_web_application_firewall_policies_operations.py index a5f22c624a7b9..ac94d9f36d146 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_11_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_metadata.json index 65948443a11d9..db1bb529789aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -145,60 +146,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -210,7 +211,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -222,19 +223,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2019_12_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2019_12_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -246,7 +247,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -258,31 +259,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_12_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_12_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_12_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2019_12_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_network_management_client.py index c5ce7cb431d86..9cafc54b312cb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/_network_management_client.py @@ -318,7 +318,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/_network_management_client.py index ba15e8853aaa5..f05e338d18030 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/_network_management_client.py @@ -315,7 +315,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_gateways_operations.py index fdb25821eb773..21e3de999683e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_security_groups_operations.py index a2baabaa45216..f982448b00198 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_delegations_operations.py index 6a87d18824bdc..7b1fbe3d7a43f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_endpoint_services_operations.py index 489a7b38ee2c8..e5dca54bbfd11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_private_endpoint_types_operations.py index 625c9c41f096d..10830596b4fa4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_resource_group_delegations_operations.py index 04b0cb1e121cf..ddea7a77380fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_service_aliases_operations.py index 33f3fe0b192cc..4db76823dcca7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 13c0032993270..b7d0b7ae5feea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewalls_operations.py index 0ce906665afd2..6f67b21cb4f2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bastion_hosts_operations.py index c411c91b635ca..61eabd06406a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bgp_service_communities_operations.py index 100c5e393b63a..bf75ff4c8a2ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_connection_monitors_operations.py index 247713288179a..489da39650abf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_custom_policies_operations.py index 18bd69de9cd45..4c3ad988e689d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_protection_plans_operations.py index fa62c62e3b8d8..2fdc8bea563ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_default_security_rules_operations.py index db5eb95cd6380..8c84f0360508b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_authorizations_operations.py index 5abd574796b46..bc8153c9c6a81 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_connections_operations.py index 364478f8ac175..7948f51a3264e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_peerings_operations.py index 7eab01a854eb9..fe514479e2aed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuits_operations.py index b9083d9aa021a..77dfaf5e99323 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_connections_operations.py index a48e69ce8f236..6e795a18af61e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 32da467b416ca..ec672838bd451 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connections_operations.py index e8173fb572307..8a58a2eaf2c9a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_gateways_operations.py index 08f6798c7647a..b27d93850e9a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_links_operations.py index 47fffa24364a3..a6e2cafaa505b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_locations_operations.py index fbbd72f74fd06..1478a395eda31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_operations.py index aa1340b096ffb..80b09ad97c321 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_service_providers_operations.py index 80a287a2da5b2..e5ebc92930fe4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policies_operations.py index 0764d48d8c46a..dc52480516310 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policy_rule_groups_operations.py index 426ce899dd0a2..53c3e1255de10 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_flow_logs_operations.py index 6011358db0b11..be69d02109b50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FlowLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> "models.FlowLog": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> AsyncLROPoller["models.FlowLog"]: + ) -> AsyncLROPoller["_models.FlowLog"]: """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.FlowLogListResult"]: + ) -> AsyncIterable["_models.FlowLogListResult"]: """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -408,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_hub_virtual_network_connections_operations.py index 6bac880303809..3e2f1ee697300 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_inbound_nat_rules_operations.py index 8ae8833e1c1e4..578d0160ea9de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ip_groups_operations.py index 5a071db4c5a13..9b990e14f64a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2019_12_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 2749ee677300e..1d0dad6a1dce9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 8c0e8a19d9908..62368a5305e5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 0d584ed2ca8a5..09cfbf6821311 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_network_interfaces_operations.py index c84854d98db54..da8e3345f6cd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_outbound_rules_operations.py index df0c69b534a86..a935428adfd54 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_probes_operations.py index 66a3e6988e721..b2dce0a93bf4f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancers_operations.py index 911bdac05e163..1763bab46dde9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_local_network_gateways_operations.py index 0ce2fa10434af..ad458f52c09a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_nat_gateways_operations.py index 4b856b0aae3e5..7d3db745ea1b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +349,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +491,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_ip_configurations_operations.py index 7e680e53b36d3..8d57c8b6ef59a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_load_balancers_operations.py index 0259be082aaba..359b604758796 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_tap_configurations_operations.py index bb8745ad15234..6534484e852a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interfaces_operations.py index 0ca1109cda26b..c427b776a68a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_management_client_operations.py index fa40fb6105536..83120a31913c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_12_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_profiles_operations.py index e8bf062277b71..34dc96c9eddf4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_security_groups_operations.py index 89792a049c3c9..f2f022cea7031 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_virtual_appliances_operations.py index 11356c4cdd9c4..e8e6bc6979bb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkVirtualAppliancesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_virtual_appliance_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def update_tags( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -228,7 +234,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + ) -> "_models.NetworkVirtualAppliance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,9 +341,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: + ) -> AsyncLROPoller["_models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -382,7 +388,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -400,7 +412,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_watchers_operations.py index 37f55a8801c43..eb0d4695b81ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2019_12_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1620,7 +1674,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1699,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1663,10 +1723,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1702,7 +1762,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1721,9 +1781,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1744,7 +1804,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1769,7 +1829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1787,10 +1853,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1826,7 +1892,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1845,9 +1911,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1871,7 +1937,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_operations.py index 3e07105d23733..4b63229dbfe67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_p2_svpn_gateways_operations.py index 47835ce0bbb2d..03e0656ca354d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -245,7 +251,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -379,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -407,7 +419,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +486,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,10 +545,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,9 +600,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -636,7 +648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +673,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -723,7 +741,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,10 +789,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,9 +844,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -843,7 +867,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -868,7 +892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -886,7 +916,7 @@ async def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -936,7 +966,7 @@ async def begin_disconnect_p2_s_vpn_connections( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource @@ -981,7 +1011,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_packet_captures_operations.py index 260cd9f25360a..a11ceee463a40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py index 908ff793a8025..b28b4eb02ed70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_endpoints_operations.py index 554a3ef97e677..56f9c4e37b00e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_link_services_operations.py index 1e918eef2094e..b4187b0e81278 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_addresses_operations.py index e5213e0eb21f3..4a6540e8644b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_prefixes_operations.py index 5ae6fbffe79c4..08a9fdfb197f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_resource_navigation_links_operations.py index 6537640c8c9bc..df1715897e736 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filter_rules_operations.py index 6524e3c068976..e72896b1c628a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filters_operations.py index bc8495ed476c0..65f75f1fd2a24 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_tables_operations.py index 1a80798280b50..925c7cfa90527 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_routes_operations.py index 742836be107e1..b9b038ca4029a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_security_rules_operations.py index f0570fe30fcaa..2bb326618d374 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_association_links_operations.py index 973f825a8e4ed..3b734c265f76c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policies_operations.py index 02cbd5591579c..3636088c12cf0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 59acf6737db32..4e757bf17ea37 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_tags_operations.py index 05b10a776c766..3751470f3fb70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_subnets_operations.py index bf7ec9e4673d2..e56b6a9419d7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_usages_operations.py index 15c452dc3cfe7..47b13dd6d917f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index efa84d8e06171..8214778d4a48a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hubs_operations.py index fc4c8c014aca7..601f2525fd926 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateway_connections_operations.py index ae865f108ca2d..995bbe87535dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateways_operations.py index 778c4d8f34e62..0b740b4b0d9a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2229,7 +2325,7 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2279,7 +2375,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. @@ -2323,7 +2419,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_peerings_operations.py index 32420e52b162a..1059fda7cbd86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_taps_operations.py index c009bf8bf36d5..55aee7ea2c762 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_networks_operations.py index 7325b834ee8c8..f527efe26cd4b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_12_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_router_peerings_operations.py index 927c660cd2b2e..f449c94d41853 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_routers_operations.py index 29e1325eade68..22a9e6a32ccd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_wans_operations.py index df76ddd889618..02a38b99dc554 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_connections_operations.py index 05f3f640ede24..09a130e1d10d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_gateways_operations.py index 3dad17be9b157..dd8ef9ff599db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -244,7 +250,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +384,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,8 +409,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +458,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,7 +476,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -488,7 +500,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -506,7 +524,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -516,7 +534,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +593,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +601,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_link_connections_operations.py index 60fcb94b2cb8b..69e0b963165da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 97dda90078adf..472b3f07fcd8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_operations.py index 7b9512204ccd8..2a24cece22ac7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_link_connections_operations.py index fb9a704e80e8f..075dd7422dbb7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_links_operations.py index ee797b34f0916..ecaa0da5fda89 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_configuration_operations.py index e1f5678c86e6b..02797d447f4b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_operations.py index d155d3a852e26..6ae02159fc5e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_web_application_firewall_policies_operations.py index b5b69f09627bd..2b88042a5b013 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_gateways_operations.py index fb106f6fca61d..af97b5a8602f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_security_groups_operations.py index e9bf7510eaa06..def6e2f8858c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_delegations_operations.py index ef15c0b394f70..780ccd42d1369 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_endpoint_services_operations.py index d254fab35278f..5ea79322a448a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_private_endpoint_types_operations.py index fdf140c71733d..9a559a5810b49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_resource_group_delegations_operations.py index f1b08536a426a..077178da006a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_service_aliases_operations.py index ba3dd2cda8453..1a90b2bf1db11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewall_fqdn_tags_operations.py index 72d0f7e52c2a4..a123aa0171d83 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewalls_operations.py index 6f789b63dedf5..9b2ff16dad400 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bastion_hosts_operations.py index 7bc4fb11a45a3..acd68cafb8fe9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bgp_service_communities_operations.py index 3fea5f7432ff2..4e516f796e148 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_connection_monitors_operations.py index 1037d42ed2dbd..4cb8c7a13868b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py index 79428ab16b59f..cd044f4c45ea2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_protection_plans_operations.py index 4adfd14ec34ff..8041f485115d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_default_security_rules_operations.py index 40410ec8e9478..5ab8c382da6c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_authorizations_operations.py index ae0d9e7cc9534..116d299adde66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_connections_operations.py index c5bebbbebb339..79884e9fb5cf3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_peerings_operations.py index 3f2619ec3c095..e614e3cf7b815 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuits_operations.py index 4a82ecc3c12a0..ba9ea36c378c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_connections_operations.py index 52b652b21644d..12a338c53d9ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connection_peerings_operations.py index 479cf7fc25188..bc73352e7ea27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connections_operations.py index 97ec0985ec973..b7509e4ca3955 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_gateways_operations.py index 6619f63b8a2f0..72f0aafdba8a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_links_operations.py index efe8d3344af47..736936550cf6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_locations_operations.py index a4309be5b1b5e..6dcea6792e2cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_operations.py index abb57282b643f..b8bd9b852ecdb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_service_providers_operations.py index c6e8cf2b49c16..0e7d368b3fd36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policies_operations.py index 7da5a71bbfa85..8aaf1731aa010 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policy_rule_groups_operations.py index 6d85b0bd0a859..7cd331a8618fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_flow_logs_operations.py index d99f937ce4f75..082f8789a8380 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FlowLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLog"] + # type: (...) -> LROPoller["_models.FlowLog"] """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FlowLogListResult"] + # type: (...) -> Iterable["_models.FlowLogListResult"] """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_hub_virtual_network_connections_operations.py index 43293540a92e3..3822f1eac7df6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_inbound_nat_rules_operations.py index b7457dc869db6..9505b7f46dcaf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ip_groups_operations.py index b144c37a8122e..210303237e359 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2019_12_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_backend_address_pools_operations.py index b4de70f418c37..00db877c9c09b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 9b57e72ff4cff..0d3cdcc2f112a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_load_balancing_rules_operations.py index e10192501c593..0f17231062c56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_network_interfaces_operations.py index 55040e27fb98c..51c4283660b4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_outbound_rules_operations.py index 2a25a6aa8300c..23607acb878d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_probes_operations.py index c6dbddc307852..8eba22fb2bf65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancers_operations.py index e2d18ae3859d2..49d1ffe8ae87c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_local_network_gateways_operations.py index 5bdb3eece9c26..57737022c29e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_nat_gateways_operations.py index e90b4db08f44a..0a3b78f339248 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +358,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +375,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_ip_configurations_operations.py index 80ed94ac8a098..ec8fdeb3cd637 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_load_balancers_operations.py index e9167bfe2e312..2259edac10d8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_tap_configurations_operations.py index 77affcb6a17bb..a5877510c2fa8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interfaces_operations.py index 7b5c874f8aa6d..7134f16077561 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_management_client_operations.py index b666a8cf27334..19449848cde82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2019_12_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_profiles_operations.py index e98b076eb1765..c67c247e21a29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_security_groups_operations.py index 50f0481478e80..156ac09e8c893 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_virtual_appliances_operations.py index bccdc2531cd2c..05dc38ce213a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkVirtualAppliancesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def update_tags( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -236,7 +242,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -286,11 +292,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + # type: (...) -> "_models.NetworkVirtualAppliance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,10 +350,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] + # type: (...) -> LROPoller["_models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -392,7 +398,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -411,7 +423,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_watchers_operations.py index 12ee40b67731d..ea0669c30cad7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2019_12_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1650,7 +1704,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1675,7 +1729,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1693,11 +1753,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1733,7 +1793,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1752,10 +1812,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1776,7 +1836,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1801,7 +1861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1819,11 +1885,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1859,7 +1925,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1878,10 +1944,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1905,7 +1971,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1930,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_operations.py index a0b97ccfcb5e5..c95b26e1552f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_p2_svpn_gateways_operations.py index cf279bd65df0d..9dc1b26763802 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -253,7 +259,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -389,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,7 +420,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,7 +430,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +498,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,11 +557,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,10 +613,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -650,7 +662,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -670,8 +688,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -739,7 +757,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -781,11 +805,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,10 +861,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -861,7 +885,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -886,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -904,7 +934,7 @@ def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -955,7 +985,7 @@ def begin_disconnect_p2_s_vpn_connections( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1001,7 +1031,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_packet_captures_operations.py index 63b223b837480..670c8035dc227 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_peer_express_route_circuit_connections_operations.py index 72b53e250f80b..e0345f1d617ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_endpoints_operations.py index 3aaf71c41e5e8..759bb2270a8e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_link_services_operations.py index eda5df7cc5d4b..78fdea90f59d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_addresses_operations.py index c9feac08d6c72..d83b617ec8f5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_prefixes_operations.py index 63a91beb53174..033eae5ea1537 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_resource_navigation_links_operations.py index 3c33ef24edc2a..5466dd9b0eb34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filter_rules_operations.py index cfc84dcc0ea2d..5402433f7549c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filters_operations.py index 0716a75b51b21..e256ee3e2a53e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_tables_operations.py index b32a1999282d6..cccb2dfc06662 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_routes_operations.py index 805c317430132..fd77dcef8ade8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_security_rules_operations.py index 59e6991b25fac..21d44161c92ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_association_links_operations.py index b63904f9fa7f3..431272ac769c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policies_operations.py index 0104381947bdd..f2c07e4880e9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policy_definitions_operations.py index bce44fd051358..a3b3249a23ef2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_tags_operations.py index 460f7ff19ac96..3f2e909d12fb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_subnets_operations.py index 099cc25f47dcd..ba0c935fad7b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_usages_operations.py index 2fbae729d20cb..e63c31f56cbb6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hub_route_table_v2_s_operations.py index c0c7c697bfc08..e923424787398 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hubs_operations.py index 005593943f070..d94ca6b334a97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateway_connections_operations.py index b8eb9efdb0ed5..c3d9bde5061fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateways_operations.py index b29b3a8cc3e7c..8c3a557ae7193 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2270,7 +2366,7 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -2321,7 +2417,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2366,7 +2462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_peerings_operations.py index 5555f1d3cc22b..171a43c1f50fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_taps_operations.py index e4699cf25dff6..41a2e5641bfb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_networks_operations.py index ce75e8e3dd6b8..7a9dd38f18f25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2019_12_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_router_peerings_operations.py index a323bbf056521..97ea3372c0497 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_routers_operations.py index 8c06233e4841f..bf4494119b6d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_wans_operations.py index a803c5f1cfff5..a25fcb15150fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_connections_operations.py index d5764222eb2c7..4327ea75c3832 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_gateways_operations.py index 10d5ef916709e..9c20061f21278 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -252,7 +258,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,7 +394,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,8 +420,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,7 +470,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -476,7 +488,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -519,7 +537,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -529,7 +547,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +607,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -597,7 +615,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_link_connections_operations.py index 20bdb99409add..cd9796aae5808 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 65354872a1051..e4b511ee74419 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_operations.py index dc4c8ea63c663..5e6e36f69e7a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_link_connections_operations.py index fc08fe7e56efd..aadb120dbe674 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_links_operations.py index 6be0c5dde3af8..888acc228978e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_configuration_operations.py index 1713d5a5432bc..02869eff9a97b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_operations.py index 1184329fa18ef..07e0c9df752c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_web_application_firewall_policies_operations.py index 561d8c23b67f5..2f50caf9c5cb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2019_12_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_metadata.json index 8537e5a4a772b..41922ed2cc387 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -148,60 +149,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -213,7 +214,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -225,19 +226,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_03_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_03_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -249,7 +250,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -261,31 +262,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_03_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_03_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_03_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_03_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_network_management_client.py index 8f7a21e21b03f..5bf3c34c0bc6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/_network_management_client.py @@ -327,7 +327,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/_network_management_client.py index 66524ae460382..fd1b930fcc95e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/_network_management_client.py @@ -324,7 +324,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_gateways_operations.py index 71b444c7ab595..8de578750d6a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_security_groups_operations.py index 043c263480b45..3003b8995b336 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_delegations_operations.py index bee03c1cd40ca..e13e4299d50c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_endpoint_services_operations.py index fc901da3ce3e9..6bdeae2a916e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_private_endpoint_types_operations.py index eae763efaa7d7..99650a8a60828 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_resource_group_delegations_operations.py index 15fb364cdb2be..cd3ac789f58b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_service_aliases_operations.py index 969bdbe1e3b45..794f3bb1a554d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index bca41d8c7ba8f..5087ef7ffdd00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewalls_operations.py index 2ab4e33911a2b..3071ca6a881d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.AzureFirewall"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + ) -> Optional["_models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -526,7 +544,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bastion_hosts_operations.py index e386b2bc48eef..06b6fac35df36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bgp_service_communities_operations.py index b593e64499260..06c9fbe92e918 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_connection_monitors_operations.py index 49c4c6a77464d..2d82f297fc32c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_custom_policies_operations.py index 15c3403840cf5..ffd2823370308 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_protection_plans_operations.py index a19bce68b23e6..bbb571f5b1e37 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_default_security_rules_operations.py index 0d054a5975fcd..bb7777b4c4468 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_authorizations_operations.py index 8428a66db2387..edc74fedf434e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_connections_operations.py index 760d205126dbe..6e6310daf6f25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_peerings_operations.py index ed761e46536c9..b539c3052467a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuits_operations.py index ceedcd2932b60..760321f15653f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_connections_operations.py index 3987e1272f05e..2b313bc0be3a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connection_peerings_operations.py index aacc2856aa087..002f6628fe526 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connections_operations.py index 1d56b861bea84..b381d7dc16a23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_gateways_operations.py index dbfeb27b20e86..a7a6e40fc18da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_links_operations.py index c88e0a0955fa8..4216025e33586 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_locations_operations.py index 9331a18092126..18d6970640a19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_operations.py index 7a31144bd3a40..dfff83cc2b1c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_service_providers_operations.py index 20ae2a6761050..bd3e36af2a4be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policies_operations.py index 3c9edbfcce59d..d5e330bc02eb4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policy_rule_groups_operations.py index d19a3f846cde0..3c40a5a83e939 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_flow_logs_operations.py index 6d80b1fba2456..46d4694143a60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FlowLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> "models.FlowLog": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> AsyncLROPoller["models.FlowLog"]: + ) -> AsyncLROPoller["_models.FlowLog"]: """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.FlowLogListResult"]: + ) -> AsyncIterable["_models.FlowLogListResult"]: """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -408,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_hub_virtual_network_connections_operations.py index 6a7a0b3401ed8..b0e916e1b540b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_inbound_nat_rules_operations.py index 5da22867958ca..11cf249ef507a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_allocations_operations.py index b94055879953b..5f652d643cb29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpAllocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( ip_allocation_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> "models.IpAllocation": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + ) -> "_models.IpAllocation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> AsyncLROPoller["models.IpAllocation"]: + ) -> AsyncLROPoller["_models.IpAllocation"]: """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_groups_operations.py index e6988b9273448..4836bf3011759 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 36b24039e72c2..a648dc8a43d61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index f81b31f2ce7f2..d51714552a642 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index c036f7c5f4c59..8d0d46926a9dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_network_interfaces_operations.py index 46a4eb9a66222..c5423b6711c8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_outbound_rules_operations.py index 3d2e52e8ded30..4a896bd99b652 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_probes_operations.py index 6fbb3ecf82cf4..93bc9f8af588b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancers_operations.py index dd57bb7db4561..509a8274e395b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_local_network_gateways_operations.py index 133f6cc555789..e7a55ffb46721 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_nat_gateways_operations.py index 6908a4cf09f25..825f1940e40fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +349,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +491,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_ip_configurations_operations.py index 1fa5edf98588d..056672474f33b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_load_balancers_operations.py index f5330832a60fe..4af2a484817c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_tap_configurations_operations.py index 7358ab8e80e66..98a726b475828 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interfaces_operations.py index a288d59c92478..a380dfdf3196e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_management_client_operations.py index 09b2ff71bf561..7216bea3cb461 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_03_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_profiles_operations.py index a66c0a616773f..2428aa23ee8d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_security_groups_operations.py index b69169297e2ae..8254768149274 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_virtual_appliances_operations.py index 5f7020c85618c..96f3d214e93b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkVirtualAppliancesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_virtual_appliance_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def update_tags( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -228,7 +234,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + ) -> "_models.NetworkVirtualAppliance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,9 +341,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: + ) -> AsyncLROPoller["_models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -382,7 +388,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -400,7 +412,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_watchers_operations.py index ab4702f5dc206..65bc03eae581c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2020_03_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1620,7 +1674,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1699,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1663,10 +1723,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1702,7 +1762,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1721,9 +1781,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1744,7 +1804,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1769,7 +1829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1787,10 +1853,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1826,7 +1892,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1845,9 +1911,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1871,7 +1937,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_operations.py index ff03a53dbb2ae..2ddb6daf7acfd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_p2_svpn_gateways_operations.py index c9c66cb451c8c..9b63bb5c5ab0a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -245,7 +251,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -379,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -407,7 +419,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +486,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,10 +545,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,9 +600,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -636,7 +648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +673,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -723,7 +741,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,10 +789,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,9 +844,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -843,7 +867,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -868,7 +892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -886,7 +916,7 @@ async def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -936,7 +966,7 @@ async def begin_disconnect_p2_s_vpn_connections( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource @@ -981,7 +1011,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_packet_captures_operations.py index eb782b1572f9e..ccb0a3d746605 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_peer_express_route_circuit_connections_operations.py index a742e0cf49082..626d305158575 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_dns_zone_groups_operations.py index 5791c27a9ac32..818cac4456ba9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateDnsZoneGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs - ) -> "models.PrivateDnsZoneGroup": + ) -> "_models.PrivateDnsZoneGroup": """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> "models.PrivateDnsZoneGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + ) -> "_models.PrivateDnsZoneGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> AsyncLROPoller["models.PrivateDnsZoneGroup"]: + ) -> AsyncLROPoller["_models.PrivateDnsZoneGroup"]: """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( private_endpoint_name: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateDnsZoneGroupListResult"]: + ) -> AsyncIterable["_models.PrivateDnsZoneGroupListResult"]: """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +420,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_endpoints_operations.py index 1439bb143015d..42bb68535caf8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_link_services_operations.py index 12fa006511f1f..f17eb0fa617fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_addresses_operations.py index 683f79f331af5..eeb5a0db0d10e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_prefixes_operations.py index f06c9f080cc62..afeacfffd6616 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_resource_navigation_links_operations.py index c0847bd823751..e5511b06b81e5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filter_rules_operations.py index 11868ac8c55a5..8e29e3e8cecae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filters_operations.py index 4212070652c28..dcbefc5d0ed2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_tables_operations.py index e4f337de3811c..955f4d9659eef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_routes_operations.py index dec94ac306371..44abf6488f651 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_partner_providers_operations.py index 1b2644e6132b5..1e96a7ef4cc60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityPartnerProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, security_partner_provider_name: str, **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> "models.SecurityPartnerProvider": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + ) -> "_models.SecurityPartnerProvider": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> AsyncLROPoller["models.SecurityPartnerProvider"]: + ) -> AsyncLROPoller["_models.SecurityPartnerProvider"]: """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +477,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -473,7 +485,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_rules_operations.py index 9f1e8fad3d814..63ec5e63389ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_association_links_operations.py index 30c46aba7a35c..955cf350c0c31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policies_operations.py index bde72a0e5d84c..68ecb5180e81e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policy_definitions_operations.py index d9d173bfcbf6d..766195c0cad77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_tags_operations.py index 4bb474530079f..ce2a7b42b8ba0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_subnets_operations.py index 7eb24448f6324..348c80ab35289 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_usages_operations.py index 373a72a0746d6..24e7364eaeadc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index f35b6d03b9f8d..32c13638072e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hubs_operations.py index 5866630a7a69c..dde9e8c5b7f03 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateway_connections_operations.py index 563e6d5b8e9f5..cc628dadd03c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateways_operations.py index 27448a4f9be76..f665cbbb4fb72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2229,7 +2325,7 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2279,7 +2375,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. @@ -2323,7 +2419,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_peerings_operations.py index 1a2fc8c2af2a2..902792621afcc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_taps_operations.py index 8b3e5791348fd..c38165af15d92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_networks_operations.py index 470e12ebaecf2..b66cb6149a679 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_03_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_router_peerings_operations.py index 931848c87c6e8..66e9a5212be09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_routers_operations.py index 8758e85a4f93a..8ec9256730e30 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_wans_operations.py index 5ff423f72ac9b..69626d7ae7d84 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_connections_operations.py index 6d47f0e33c084..d5645517c7c8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_gateways_operations.py index bc84eee307d55..9ec1c9edfced5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -244,7 +250,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +384,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,8 +409,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +458,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,7 +476,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -488,7 +500,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -506,7 +524,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -516,7 +534,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +593,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +601,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_link_connections_operations.py index 84acb5832394f..0048af9bd7594 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 47256d9cf1f4e..4e33ca615a65f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_operations.py index 67a7759e39ca2..92be5a0b7052c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_link_connections_operations.py index 77c60fb58c4c5..b9d407fec9cad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_links_operations.py index 6cfbeda8eb773..6a9b890f67241 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_configuration_operations.py index 3404d0660de26..a4138bc753fec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_operations.py index 306631a1eadf3..8dabbc76d9a8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_web_application_firewall_policies_operations.py index 7ea989d583963..6ae44cb6857d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_gateways_operations.py index 0a8fe3c1a276b..34c9a6c7a3b67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_security_groups_operations.py index 73b3ba08f94b0..5ff7a0fb73a62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_delegations_operations.py index f30a392fb068a..fe9a49727ecb6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_endpoint_services_operations.py index 33f7162832ad1..edf7d1125f35c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_private_endpoint_types_operations.py index 6274de741c375..f68f767d45a1f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_resource_group_delegations_operations.py index 65791bf511e49..56b71dffd0f3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_service_aliases_operations.py index 36c2651a50b09..0d5f574895353 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewall_fqdn_tags_operations.py index 47c798ca3f352..f3247c8210531 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewalls_operations.py index 7abbfe4442e0f..d8f7040fa178d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.AzureFirewall"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + # type: (...) -> Optional["_models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -539,7 +557,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bastion_hosts_operations.py index 70010c21fcf38..a57a9da99d6f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bgp_service_communities_operations.py index 42e2587449083..c651b9cb6c98d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_connection_monitors_operations.py index 0a88bacb8a980..46689ddf45957 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_custom_policies_operations.py index b23ac2eff16ee..b208afa9aca73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_protection_plans_operations.py index e5408a940425d..3a7e2bdd043d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_default_security_rules_operations.py index 450a03635f4b0..a818be2379256 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_authorizations_operations.py index 4bf412f7346e3..5d700de71bf7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_connections_operations.py index 5119f8a18ff17..a2f584b3779d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_peerings_operations.py index 95adb34af5faa..652d12146835d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuits_operations.py index 7d13ca29d4e6f..a52600618acd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_connections_operations.py index ca8151fdbe6b8..729fca09912c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connection_peerings_operations.py index 8f4902aa62552..b53e7e36611ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connections_operations.py index 4a89b6f4aacfc..fdfa05dec6b12 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_gateways_operations.py index 7ec7e728a183a..47fde31aedd2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_links_operations.py index 443cddbcb9d50..a03ed98fe4fd2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_locations_operations.py index dd801510c3716..3659f6b74de4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_operations.py index 616e663d77a38..069b4e91750c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_service_providers_operations.py index 1fffd15afbf68..e864b84196cd5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policies_operations.py index 94865d8957da8..f902eef1d37b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policy_rule_groups_operations.py index 5911e1be9ecbc..3a9bea45dc900 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_flow_logs_operations.py index 8647b02a85026..f7e4fa02fbe10 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FlowLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLog"] + # type: (...) -> LROPoller["_models.FlowLog"] """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FlowLogListResult"] + # type: (...) -> Iterable["_models.FlowLogListResult"] """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_hub_virtual_network_connections_operations.py index 7a9f292aada17..4be091adedef5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py index 7f76cf921ff6c..7d50c15881f2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_allocations_operations.py index 1b8e0d70ad425..1b721799c7464 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpAllocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + # type: (...) -> "_models.IpAllocation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpAllocation"] + # type: (...) -> LROPoller["_models.IpAllocation"] """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_groups_operations.py index 4d2d1ab18a11c..dd0018ced75e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2020_03_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_backend_address_pools_operations.py index 54b4ddc2942c2..1183d557686c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_backend_address_pools_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 653cbf7605b8a..f7645b1b6762b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_load_balancing_rules_operations.py index b60072c79226a..76fcfb934b0ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_network_interfaces_operations.py index b53d8216d8257..43feba9796683 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_outbound_rules_operations.py index 7ca41bc785eac..a9b8e217bb27a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_probes_operations.py index 891dfe0b65481..bbe185a0f119c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancers_operations.py index aa68d01519d1b..b01b4bf81cfe1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_local_network_gateways_operations.py index 5b4acab2d2f75..14c08613376f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_nat_gateways_operations.py index 9f65ddcdd71fb..3ac6774f97aba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +358,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +375,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_ip_configurations_operations.py index 924c622d240bc..5063a656e91c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_load_balancers_operations.py index cb79212c5d451..642def4b9a7db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_tap_configurations_operations.py index 0b22a1dc7f5e9..0ae65a2faa1f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interfaces_operations.py index 052eeacfa2019..de153ba47a7ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_management_client_operations.py index 7bdaa34e83a97..314966fe0fc9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_03_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_profiles_operations.py index 06e39b69c75f6..638c753e0ee5f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py index fec1d66d52496..98a737ee68c17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_virtual_appliances_operations.py index b9983eea74585..f4b1e76a3f517 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkVirtualAppliancesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def update_tags( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -236,7 +242,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -286,11 +292,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + # type: (...) -> "_models.NetworkVirtualAppliance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,10 +350,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] + # type: (...) -> LROPoller["_models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -392,7 +398,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -411,7 +423,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_watchers_operations.py index 1a3d449a1a1be..2030436e23e68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2020_03_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1650,7 +1704,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1675,7 +1729,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1693,11 +1753,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1733,7 +1793,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1752,10 +1812,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1776,7 +1836,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1801,7 +1861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1819,11 +1885,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1859,7 +1925,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1878,10 +1944,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1905,7 +1971,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1930,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_operations.py index f9a0abf2e728f..bcd841e7cc447 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_p2_svpn_gateways_operations.py index 493e286d97e94..70e80fbc529fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -253,7 +259,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -389,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,7 +420,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,7 +430,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +498,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,11 +557,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,10 +613,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -650,7 +662,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -670,8 +688,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -739,7 +757,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -781,11 +805,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,10 +861,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -861,7 +885,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -886,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -904,7 +934,7 @@ def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -955,7 +985,7 @@ def begin_disconnect_p2_s_vpn_connections( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1001,7 +1031,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py index 77254c3cd3757..f77faae73b46c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_peer_express_route_circuit_connections_operations.py index c9a90ec75caf9..e46de0ecd3767 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_dns_zone_groups_operations.py index 716a2d66e55f7..7b334004c88d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateDnsZoneGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( private_dns_zone_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" + # type: (...) -> "_models.PrivateDnsZoneGroup" """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + # type: (...) -> "_models.PrivateDnsZoneGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateDnsZoneGroup"] + # type: (...) -> LROPoller["_models.PrivateDnsZoneGroup"] """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateDnsZoneGroupListResult"] + # type: (...) -> Iterable["_models.PrivateDnsZoneGroupListResult"] """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +430,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_endpoints_operations.py index abcf8c79415ce..c2407d2a2ad42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_link_services_operations.py index 8a97c93062677..97d09a01b8a74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_addresses_operations.py index 58aabb6e4e054..d1dbe833bb96c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_prefixes_operations.py index e361cf5b28bca..a29b89b4d0bd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_resource_navigation_links_operations.py index 4fae9dd833795..df7ffeb83ce71 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filter_rules_operations.py index 93ed78cf9c64c..211edc4060d64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filters_operations.py index 1cd04ec1bc7cb..4a3527b791d3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_tables_operations.py index 8f7d208850b64..479665ccbec2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_routes_operations.py index fd90390424e96..24282f9d21df6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_partner_providers_operations.py index 93ec80cff3668..9d9ad37706710 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityPartnerProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( security_partner_provider_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + # type: (...) -> "_models.SecurityPartnerProvider" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityPartnerProvider"] + # type: (...) -> LROPoller["_models.SecurityPartnerProvider"] """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,7 +489,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -485,7 +497,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_rules_operations.py index f705f9212f566..401d44a766131 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_association_links_operations.py index 1a31d1b1f6174..ea120a1fdc42b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policies_operations.py index 0a92126218072..955bf654778c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policy_definitions_operations.py index 4cd0ed63619a0..4a50578030a9b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_tags_operations.py index f09d280460ac1..d6f1bbd2886a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_subnets_operations.py index ba18837120d87..4bb45c653f01c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_usages_operations.py index 04b75304988c1..26d93973379d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hub_route_table_v2_s_operations.py index a618c3bdeeaab..b9f42674e852e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hubs_operations.py index a94070baa264d..cb3dcc78a7e8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateway_connections_operations.py index b6e6ace4c2d7d..bd3067cf80d58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateways_operations.py index a00ce80b9b00b..b4fe4de6847ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2270,7 +2366,7 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -2321,7 +2417,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2366,7 +2462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_peerings_operations.py index b4720a114938d..f5aaa41c6e63b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_taps_operations.py index d8a450bced130..e993b1cdd13ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_networks_operations.py index dc4e56e3fff88..5f8baa3989815 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_03_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_router_peerings_operations.py index a5c6148be345a..ec6918f522849 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_routers_operations.py index e96ec89e02bb0..84acd264b69ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_wans_operations.py index 704c38912202d..303ebc09b7dbf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_connections_operations.py index 3b81125601995..7100ee059bcf6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_gateways_operations.py index 1a2f869ec2c81..6007e3c12597d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -252,7 +258,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,7 +394,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,8 +420,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,7 +470,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -476,7 +488,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -519,7 +537,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -529,7 +547,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +607,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -597,7 +615,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_link_connections_operations.py index f28f6d000164f..917b0f76eef20 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 71c2581d0bb21..b3839e17c71ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_operations.py index b161aba072715..61af0e701f17b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_link_connections_operations.py index 5f1f306ae2f34..0c8912f11489e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_links_operations.py index 9f58c30b6771a..23704c8814a6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_configuration_operations.py index 10972e1398b3f..f38d9e16b1798 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_operations.py index 084d4aaaa7a61..8b2c4a93225fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_web_application_firewall_policies_operations.py index 7ca502d81227e..9244b5642a568 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_03_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_metadata.json index 6caff166d6eda..d8249bd9d933c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -149,60 +150,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -214,7 +215,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -226,19 +227,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_04_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_04_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -250,7 +251,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -262,31 +263,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_04_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_04_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_04_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_04_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_network_management_client.py index ac546f9b9f8ff..f8842c1b4ee71 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/_network_management_client.py @@ -330,7 +330,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/_network_management_client.py index 5bc9f37eee763..069a4804cf6b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/_network_management_client.py @@ -327,7 +327,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_gateways_operations.py index dafb40a6af77a..aae0770c64246 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_security_groups_operations.py index c2681f204c594..9beb14c26742c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_delegations_operations.py index 613638efa0f88..d870ac8b30502 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_endpoint_services_operations.py index 8d983b620872f..716532e98fe87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_private_endpoint_types_operations.py index 9f7fb0ae2fb07..c2fc9fe4d8766 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_resource_group_delegations_operations.py index 5b45a81a17d9d..2d27d68b943c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_service_aliases_operations.py index 416a33f86e621..615e253002499 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 4eb2ef4c8acaf..2a3ca6b918444 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewalls_operations.py index e59466bbd9c2f..704d98ca13a4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.AzureFirewall"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + ) -> Optional["_models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -526,7 +544,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bastion_hosts_operations.py index f95d00d8b0188..941de177c98d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bgp_service_communities_operations.py index 6a3d3497d19bf..07f8e015f691e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_connection_monitors_operations.py index 7d309d92da426..c39f9549951ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_custom_policies_operations.py index c2a5fda3af034..374762f783c3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_protection_plans_operations.py index 2cecac4b7f908..88a29483f3bd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_default_security_rules_operations.py index 53687677f770a..02cf285f15148 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_authorizations_operations.py index fd83b9098afea..245b3be43b813 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_connections_operations.py index 221cb70303e9d..fe9632584f5a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_peerings_operations.py index e630296d9d855..de67f728992ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py index a1f3ac7f11eb6..3ff9ce3ddac8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_connections_operations.py index 9e61195850b55..264c5add4a969 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 9691f3b04c53a..aea084ed7fdb4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connections_operations.py index 9fde9f7d93bf9..5460ec9bdabc1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_gateways_operations.py index 6937452f21d8a..0e370910899b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_links_operations.py index 27a99ba2e60e5..36abb6e7a933a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_locations_operations.py index 954e1f77183a3..913eeaefbef25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_operations.py index 27efd21216c55..653a724eda83c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_service_providers_operations.py index d9a5366ee9ed5..ad48b1b8a16ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policies_operations.py index 1e06826c3176c..6207393c5c9d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policy_rule_groups_operations.py index 70195a364f1f1..f517d144eb88d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> "_models.FirewallPolicyRuleGroup": """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + ) -> "_models.FirewallPolicyRuleGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_group_name: str, - parameters: "models.FirewallPolicyRuleGroup", + parameters: "_models.FirewallPolicyRuleGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleGroupListResult"]: """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_flow_logs_operations.py index 376bbdfc69e2f..9579a4f5a7206 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FlowLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> "models.FlowLog": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> AsyncLROPoller["models.FlowLog"]: + ) -> AsyncLROPoller["_models.FlowLog"]: """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.FlowLogListResult"]: + ) -> AsyncIterable["_models.FlowLogListResult"]: """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -408,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_route_tables_operations.py index 0ae3c5d98de42..d5d79d4081970 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class HubRouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - route_table_parameters: "models.HubRouteTable", + route_table_parameters: "_models.HubRouteTable", **kwargs - ) -> "models.HubRouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + ) -> "_models.HubRouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - route_table_parameters: "models.HubRouteTable", + route_table_parameters: "_models.HubRouteTable", **kwargs - ) -> AsyncLROPoller["models.HubRouteTable"]: + ) -> AsyncLROPoller["_models.HubRouteTable"]: """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.HubRouteTable": + ) -> "_models.HubRouteTable": """Retrieves the details of a RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.HubRouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubRouteTablesResult"]: + ) -> AsyncIterable["_models.ListHubRouteTablesResult"]: """Retrieves the details of all RouteTables. :param resource_group_name: The resource group name of the VirtualHub. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListHubRouteTablesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_virtual_network_connections_operations.py index fa609ca88ec3b..39af5e922dfee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_inbound_nat_rules_operations.py index 81152a911c65a..2ed1968ac56a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_allocations_operations.py index 4efad5d8f15f7..ef7eb819402da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpAllocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( ip_allocation_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> "models.IpAllocation": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + ) -> "_models.IpAllocation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> AsyncLROPoller["models.IpAllocation"]: + ) -> AsyncLROPoller["_models.IpAllocation"]: """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_groups_operations.py index 3f08e57c4ad14..c6f80f7a5c6d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 99933d79a7514..08cca6cf67b00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,10 +184,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, - parameters: "models.BackendAddressPool", + parameters: "_models.BackendAddressPool", **kwargs - ) -> "models.BackendAddressPool": - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + ) -> "_models.BackendAddressPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,9 +243,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, - parameters: "models.BackendAddressPool", + parameters: "_models.BackendAddressPool", **kwargs - ) -> AsyncLROPoller["models.BackendAddressPool"]: + ) -> AsyncLROPoller["_models.BackendAddressPool"]: """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -268,7 +268,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -294,7 +294,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index d695ae4766275..829cce08e8b65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 33a1aaa87125a..68a138299bf7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_network_interfaces_operations.py index 8571a8663a2c0..751f5a5b45909 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_outbound_rules_operations.py index eb82ae54b9f87..012521fb8b53e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_probes_operations.py index a6f93008d7a83..bfd25bc7bb622 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancers_operations.py index 4200041f33461..8ecdb2232f51d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_local_network_gateways_operations.py index 83cc6654aa44f..7171a7fa4da7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_nat_gateways_operations.py index d5a4f20829c03..94bf94a38576b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +349,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +491,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_ip_configurations_operations.py index 198ddc82a8278..1687d6d1016a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_load_balancers_operations.py index 013e59af7e174..d90d7a6339202 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_tap_configurations_operations.py index 7e5c37673d4f2..31d35bd4dd241 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interfaces_operations.py index 31b3fa9d606fe..ce2c7d1d42462 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_management_client_operations.py index b5ef06c1443c9..b68b699bca101 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_04_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_profiles_operations.py index 925eb9018c369..e4cabaa1ee0c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_security_groups_operations.py index 7467d7fea2c76..57384c67be48f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_virtual_appliances_operations.py index a23a0a501468a..92db84193e6ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkVirtualAppliancesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_virtual_appliance_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def update_tags( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -228,7 +234,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + ) -> "_models.NetworkVirtualAppliance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,9 +341,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: + ) -> AsyncLROPoller["_models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -382,7 +388,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -400,7 +412,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_watchers_operations.py index 8afb1effea038..6b3e0e32eeec7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2020_04_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1620,7 +1674,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1699,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1663,10 +1723,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1702,7 +1762,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1721,9 +1781,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1744,7 +1804,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1769,7 +1829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1787,10 +1853,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1826,7 +1892,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1845,9 +1911,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1871,7 +1937,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_operations.py index 21f09a7f782bb..58fca1687a375 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_p2_svpn_gateways_operations.py index 18895caaedbaf..ffd5482fdd0f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -245,7 +251,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -379,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -407,7 +419,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +486,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,10 +545,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,9 +600,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -636,7 +648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +673,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -723,7 +741,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,10 +789,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,9 +844,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -843,7 +867,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -868,7 +892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -886,7 +916,7 @@ async def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -936,7 +966,7 @@ async def begin_disconnect_p2_s_vpn_connections( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource @@ -981,7 +1011,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_packet_captures_operations.py index 22110d0bd1967..cbdbb06cd1443 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py index a10b2a739dbf0..7e3f3a44a45ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_dns_zone_groups_operations.py index f64a372be2c32..2c6e8aaece804 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateDnsZoneGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs - ) -> "models.PrivateDnsZoneGroup": + ) -> "_models.PrivateDnsZoneGroup": """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> "models.PrivateDnsZoneGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + ) -> "_models.PrivateDnsZoneGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> AsyncLROPoller["models.PrivateDnsZoneGroup"]: + ) -> AsyncLROPoller["_models.PrivateDnsZoneGroup"]: """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( private_endpoint_name: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateDnsZoneGroupListResult"]: + ) -> AsyncIterable["_models.PrivateDnsZoneGroupListResult"]: """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +420,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_endpoints_operations.py index 9d37f5c14f939..c4cbc8a63dcdb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_link_services_operations.py index e351f1615f706..40f28db2c8ff6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_addresses_operations.py index 51d0c2ad2228f..06c0c127327e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_prefixes_operations.py index 02a680e5bbbc3..f625c839f7adc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_resource_navigation_links_operations.py index f8d3084002545..ef466ddd703f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filter_rules_operations.py index edd5b8a81bc12..48c628988a46f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filters_operations.py index 4886a0bd74b04..a0c6c854f1641 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_tables_operations.py index 55489856ac7a3..05600b4ebe657 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_routes_operations.py index 902bda5364439..597c5ef5df24d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_partner_providers_operations.py index 6a5346bc3e701..08c51ee0f4354 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityPartnerProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, security_partner_provider_name: str, **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> "models.SecurityPartnerProvider": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + ) -> "_models.SecurityPartnerProvider": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> AsyncLROPoller["models.SecurityPartnerProvider"]: + ) -> AsyncLROPoller["_models.SecurityPartnerProvider"]: """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +477,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -473,7 +485,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_rules_operations.py index af361560e99c6..77084f90d448d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_association_links_operations.py index c729541334748..a67b71eda0d28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policies_operations.py index 258fdddcc6656..7c724fbf56227 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py index ebf5df4a64a7a..ce3c9d5442280 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_tags_operations.py index 0f31a6ef031ab..8fda8cb84ab05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_subnets_operations.py index fabe45300fde4..d1cdfd77e124b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_usages_operations.py index 0e8291f8f21ee..fb48a6fe4326f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index 22a103e20abd2..b8442e104cd7c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hubs_operations.py index 5465df1620c84..39d86b9a9143b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateway_connections_operations.py index 78e5b73f6e12a..b35f9504e508f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateways_operations.py index 7c237636af036..46256c643b250 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2229,7 +2325,7 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2279,7 +2375,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. @@ -2323,7 +2419,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_peerings_operations.py index 44bdad021f3af..f4e5d563dd3e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_taps_operations.py index ba76619a75cc6..421a8d994e00c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_networks_operations.py index 61b234a33eb39..23546d8ad9e7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_04_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_router_peerings_operations.py index 2b032b405403c..ea4d24ec00d04 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_routers_operations.py index 0ee5d44524110..fccf08dd0e389 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_wans_operations.py index 8e9239fe0558a..feab4dc4e2c9b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_connections_operations.py index 0e7c9cc160092..f628b60a48fd0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_gateways_operations.py index e44d44d03d584..50cd0cc4702b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -244,7 +250,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +384,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,8 +409,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +458,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,7 +476,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -488,7 +500,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -506,7 +524,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -516,7 +534,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +593,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +601,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_link_connections_operations.py index 8d851600b554d..7fcb391d7917d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 11d5cef31df99..80cf5f7421bc8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_operations.py index 7b6588af15a5f..d1ddbb7d468d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_link_connections_operations.py index fecf6f1296f5e..fd6b87d950f59 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_links_operations.py index 2396a308b5dc6..d1b1395efbcca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_configuration_operations.py index 60e921503fa85..919bf46ca5d28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_operations.py index ce61768906975..12ffea081c606 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_web_application_firewall_policies_operations.py index dabc90edf90e0..6cfe12c324535 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_gateways_operations.py index 3bc2a59324b3c..f665f198a1e74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_security_groups_operations.py index 29ecea04d4e24..e81fe4c59c9cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_delegations_operations.py index 37e721a455e98..20c5ec1854b2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_endpoint_services_operations.py index f305b760cb9ef..c5985639ee912 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_private_endpoint_types_operations.py index c49977c9f2a42..44e911a17e164 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_resource_group_delegations_operations.py index 034daa968651b..b4ad15834c103 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_service_aliases_operations.py index 523d6a1bc7497..453ee270f85d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewall_fqdn_tags_operations.py index 0755b14840b3e..c5f36fcebcb09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewalls_operations.py index 3ecefa54c83bd..375e01a0a7d1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.AzureFirewall"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + # type: (...) -> Optional["_models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -539,7 +557,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bastion_hosts_operations.py index 283e088c789b8..d91cabb4ad0bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bgp_service_communities_operations.py index 3906b417df8e7..bbbe9d505b13f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_connection_monitors_operations.py index bf2f0ad90b535..f0f55346c9666 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_custom_policies_operations.py index fa6b0c48d048d..42d06b6aabf55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_protection_plans_operations.py index b93d4a5a73106..5e44528dd5cb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_default_security_rules_operations.py index bbd73b50dee46..e691b47d2f32e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_authorizations_operations.py index b7b2dddcc9bb9..c7917b3726a0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py index e09ade6edc40e..2772298161219 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_peerings_operations.py index efe675fc7f2a2..938a45f3f90e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuits_operations.py index 0856e021bd81a..e2ed74a496273 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_connections_operations.py index b1f0c49770e31..2d13e6e5f42d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connection_peerings_operations.py index a121eaa94f56b..2df08cc8107f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connections_operations.py index fbe328ec38e22..1f56c9f6998de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_gateways_operations.py index d25bf33754de6..770d63a877f54 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_links_operations.py index 594cb57a50185..3ae79ee19755a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_locations_operations.py index d762dd500877b..8f21b5b847c71 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_operations.py index 582d410532d3d..ff7d8e1ce2dc3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_service_providers_operations.py index 668857bc7787b..846941cc36c40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policies_operations.py index 14aa0f24f90ac..856c02b37237e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policy_rule_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policy_rule_groups_operations.py index 4edac641d5d5b..ffc363c962fbe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policy_rule_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_firewall_policy_rule_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" + # type: (...) -> "_models.FirewallPolicyRuleGroup" """Gets the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + # type: (...) -> "_models.FirewallPolicyRuleGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleGroup" + parameters, # type: "_models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleGroupName': self._serialize.url("rule_group_name", rule_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleGroupListResult"] """Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_flow_logs_operations.py index a3db43b61495f..2ae9bf66dcdd0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FlowLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLog"] + # type: (...) -> LROPoller["_models.FlowLog"] """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FlowLogListResult"] + # type: (...) -> Iterable["_models.FlowLogListResult"] """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_route_tables_operations.py index b0a2fd31d1afb..2d85e58d66ea8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class HubRouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - route_table_parameters, # type: "models.HubRouteTable" + route_table_parameters, # type: "_models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> "models.HubRouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + # type: (...) -> "_models.HubRouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - route_table_parameters, # type: "models.HubRouteTable" + route_table_parameters, # type: "_models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubRouteTable"] + # type: (...) -> LROPoller["_models.HubRouteTable"] """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubRouteTable" + # type: (...) -> "_models.HubRouteTable" """Retrieves the details of a RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.HubRouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubRouteTablesResult"] + # type: (...) -> Iterable["_models.ListHubRouteTablesResult"] """Retrieves the details of all RouteTables. :param resource_group_name: The resource group name of the VirtualHub. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListHubRouteTablesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_virtual_network_connections_operations.py index 4317ace3a819e..e275e8fe8bf34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_hub_virtual_network_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_inbound_nat_rules_operations.py index 954e0c8f05a1e..55ae5b497a781 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_allocations_operations.py index 2a331170a9d91..a06d2feaa982d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpAllocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + # type: (...) -> "_models.IpAllocation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpAllocation"] + # type: (...) -> LROPoller["_models.IpAllocation"] """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_groups_operations.py index b0b4ac28048e4..2348eec946afa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2020_04_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_backend_address_pools_operations.py index 8116e506d9ff0..7a20bbfcbaaba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_backend_address_pools_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -129,7 +129,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,11 +190,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str backend_address_pool_name, # type: str - parameters, # type: "models.BackendAddressPool" + parameters, # type: "_models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + # type: (...) -> "_models.BackendAddressPool" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -250,10 +250,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str backend_address_pool_name, # type: str - parameters, # type: "models.BackendAddressPool" + parameters, # type: "_models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BackendAddressPool"] + # type: (...) -> LROPoller["_models.BackendAddressPool"] """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -276,7 +276,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -302,7 +302,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 318a6ea90d4e6..61349b2595102 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_load_balancing_rules_operations.py index 02530870363e4..f2ad15774f051 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_network_interfaces_operations.py index ccc47e71be769..400da178707fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_outbound_rules_operations.py index e408b713b8620..b9e14609f2b42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_probes_operations.py index 4e010c36949cb..81260e31a4075 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancers_operations.py index 35e5c819e5544..5ca7c0fc692b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_local_network_gateways_operations.py index f023bcdf3d611..30d6f8f36602c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_nat_gateways_operations.py index 9f7927d419e57..5a0457f2ee589 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +358,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +375,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_ip_configurations_operations.py index 377633b3d5f2f..21fe97c49cb5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_load_balancers_operations.py index 329e48df57e4c..81e6e508dc93c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_tap_configurations_operations.py index 60c3a6603fa9b..dcdf2e5137eef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interfaces_operations.py index 5f3c2c961f26f..c5dc67e61d276 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_management_client_operations.py index fd6356fae869d..aa91bcd7d3e13 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_04_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_profiles_operations.py index 2a9d72e4fb9ce..999bfe2a4e633 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_security_groups_operations.py index 8f46bfe4896b4..e83a0f4808dcb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_virtual_appliances_operations.py index 1106f0692fb75..46d28b0ef26c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkVirtualAppliancesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def update_tags( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -236,7 +242,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -286,11 +292,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + # type: (...) -> "_models.NetworkVirtualAppliance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,10 +350,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] + # type: (...) -> LROPoller["_models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -392,7 +398,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -411,7 +423,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_watchers_operations.py index 6f48019119add..a0459985ef520 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2020_04_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1650,7 +1704,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1675,7 +1729,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1693,11 +1753,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1733,7 +1793,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1752,10 +1812,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1776,7 +1836,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1801,7 +1861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1819,11 +1885,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1859,7 +1925,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1878,10 +1944,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1905,7 +1971,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1930,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_operations.py index 94a5b25c76c73..9a759beb68d68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py index d5259977baf40..1c2e447c8ebd0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -253,7 +259,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -389,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,7 +420,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,7 +430,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +498,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,11 +557,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,10 +613,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -650,7 +662,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -670,8 +688,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -739,7 +757,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -781,11 +805,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,10 +861,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -861,7 +885,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -886,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -904,7 +934,7 @@ def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -955,7 +985,7 @@ def begin_disconnect_p2_s_vpn_connections( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1001,7 +1031,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py index 588f319b8fa80..39f358eea6ebd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_peer_express_route_circuit_connections_operations.py index 08ceb0cbe6fea..046ffc5f7ed0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_dns_zone_groups_operations.py index fc70dd26be8d2..c5f17ae0e3388 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateDnsZoneGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( private_dns_zone_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" + # type: (...) -> "_models.PrivateDnsZoneGroup" """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + # type: (...) -> "_models.PrivateDnsZoneGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateDnsZoneGroup"] + # type: (...) -> LROPoller["_models.PrivateDnsZoneGroup"] """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateDnsZoneGroupListResult"] + # type: (...) -> Iterable["_models.PrivateDnsZoneGroupListResult"] """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +430,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_endpoints_operations.py index a78561eefdb02..6e63bd68d8dce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_link_services_operations.py index 1d54f8adbe4eb..7fe315d4be3b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_addresses_operations.py index c70fa3796722e..6854c227d22df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_prefixes_operations.py index 0247e619808f8..72bb15940f3b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_resource_navigation_links_operations.py index 1be4966bd1ff5..c1b47a1dcb075 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filter_rules_operations.py index c9c4bafbd3a22..9d08f0b71c0d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filters_operations.py index cde5a1738d9e7..2fa0c040687c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_tables_operations.py index 9abb8fbc556d3..fb01f9acd3122 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_routes_operations.py index 800a09f699682..ab84741202521 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_partner_providers_operations.py index 236c4e025af7a..19295ca168517 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityPartnerProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( security_partner_provider_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + # type: (...) -> "_models.SecurityPartnerProvider" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityPartnerProvider"] + # type: (...) -> LROPoller["_models.SecurityPartnerProvider"] """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,7 +489,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -485,7 +497,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_rules_operations.py index f20572b6d8d48..9db4316c7aad9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py index 352cc507db5d6..81b07a350dd22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policies_operations.py index 5000c81f41192..689f425275f5c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policy_definitions_operations.py index a6b76bc430690..13b3d9db57c36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_tags_operations.py index 7d8e5edb7bdc7..64bcb8d55360c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_subnets_operations.py index 288ee972321ae..455e52ce89ddc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_usages_operations.py index bbd2dfaf76440..6f8bc9d67be66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hub_route_table_v2_s_operations.py index b8eb4551c34d2..368bd20b4188e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hubs_operations.py index 26acfa61b4e99..e1487e6ed45cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateway_connections_operations.py index 9d28a88be4049..aa8420709c150 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateways_operations.py index d9d51079bb336..afa19cd3f9242 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2270,7 +2366,7 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -2321,7 +2417,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2366,7 +2462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_peerings_operations.py index b0aa29f57cc99..11b64da9fc8d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_taps_operations.py index eae336d682dbd..64e157b9ccd66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_networks_operations.py index 18f27a715b07d..6f60a3046f434 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_04_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_router_peerings_operations.py index 83316585fa261..f8247fbc7698a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_routers_operations.py index beab3e31f27ec..31200bc0dd415 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_wans_operations.py index 919e67d7e2135..48733f6ae47a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_connections_operations.py index 9700fe8def3f9..2a108149b1262 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_gateways_operations.py index 0614f13545cf9..2ebb388b9dcb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -252,7 +258,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,7 +394,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,8 +420,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,7 +470,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -476,7 +488,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -519,7 +537,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -529,7 +547,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +607,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -597,7 +615,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_link_connections_operations.py index 9785f08e14291..7d991a2af5773 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 6d4b639736817..9f694e72b5960 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_operations.py index 1957ba7526091..f796ec9fab13a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_link_connections_operations.py index e6b02ce65f983..a7d303f93741b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_links_operations.py index 5a5986d0e991c..4cb4ddabd1fe9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_configuration_operations.py index 9de9d8ac04d66..b61542cb4ae6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_operations.py index f656c8212f062..7e9e6682ce86f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_web_application_firewall_policies_operations.py index 3f88f1e01546e..6b988ce640d24 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_04_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json index 17e1b6933a636..60573f714f914 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -156,60 +157,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -221,7 +222,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -233,19 +234,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_05_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_05_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -257,7 +258,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -269,31 +270,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_05_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_05_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_05_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_05_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_05_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_05_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py index 7192dab47b0ca..4c4627b8e0043 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py @@ -351,7 +351,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client.py index 10392bb1a7a15..f5fda6fc6a75f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client.py @@ -348,7 +348,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py index 618cffe13b15a..202f11b253aee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewayPrivateEndpointConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,10 +163,10 @@ async def _update_initial( resource_group_name: str, application_gateway_name: str, connection_name: str, - parameters: "models.ApplicationGatewayPrivateEndpointConnection", + parameters: "_models.ApplicationGatewayPrivateEndpointConnection", **kwargs - ) -> Optional["models.ApplicationGatewayPrivateEndpointConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayPrivateEndpointConnection"]] + ) -> Optional["_models.ApplicationGatewayPrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayPrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +220,9 @@ async def begin_update( resource_group_name: str, application_gateway_name: str, connection_name: str, - parameters: "models.ApplicationGatewayPrivateEndpointConnection", + parameters: "_models.ApplicationGatewayPrivateEndpointConnection", **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayPrivateEndpointConnection"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayPrivateEndpointConnection"]: """Updates the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -238,7 +245,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -264,7 +271,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -284,7 +298,7 @@ async def get( application_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ApplicationGatewayPrivateEndpointConnection": + ) -> "_models.ApplicationGatewayPrivateEndpointConnection": """Gets the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -298,7 +312,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +359,7 @@ def list( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayPrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayPrivateEndpointConnectionListResult"]: """Lists all private endpoint connections on an application gateway. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_link_resources_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_link_resources_operations.py index d1c178693905b..a34277fe1fba3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_link_resources_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateway_private_link_resources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ApplicationGatewayPrivateLinkResourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayPrivateLinkResourceListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayPrivateLinkResourceListResult"]: """Lists all private link resources on an application gateway. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateways_operations.py index c5dee1f94553d..e4b82f91e3632 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_security_groups_operations.py index 226adcbbbd8f1..e4f6aa06c394c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_delegations_operations.py index 0d8c30906a4c6..897295e7266f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_endpoint_services_operations.py index 558158c8945df..e330d89e8660d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_private_endpoint_types_operations.py index 483950e55fae3..a6a1a76c2dd9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_resource_group_delegations_operations.py index 6eed8a0495fc5..95e84af0e25c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_service_aliases_operations.py index cec85e20f27b2..995cd7dc82cf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index ed79ccfbd10f5..41ae38b433732 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewalls_operations.py index c9a3fee33efcb..9260098dbec58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.AzureFirewall"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + ) -> Optional["_models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -526,7 +544,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py index ef7985a0eebda..297d5d39254d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bgp_service_communities_operations.py index 8d77c85124cd1..53013f2a090c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_connection_monitors_operations.py index 881650530aec7..011146c321dc1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_custom_policies_operations.py index 0eae230f9be19..64a46ddcef6e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_protection_plans_operations.py index 52f3b128e1ed1..fc7c30042f2f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_default_security_rules_operations.py index e757fa8ee88ba..c5f0bf9cdda87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_authorizations_operations.py index 30ad9eb7c15d8..150e4c3c9afc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_connections_operations.py index 338d7dba3bded..b19a675567255 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_peerings_operations.py index 05f0c70cc7bd2..9ebe97a6f559f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuits_operations.py index 1d45d4dd0462f..5b3a9ee8225fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_connections_operations.py index d3d95f0504d40..6d52b1158e966 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 90d213ecf8c49..5a0527ae88236 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connections_operations.py index 94971cfd3ed43..2b9b68b1c5b67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_gateways_operations.py index 9671c79d8b1dc..0a1eba0e8f078 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_links_operations.py index 51077ec27d6af..a6a261fc37191 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_locations_operations.py index cb2f29775fc33..ffc4961fd5b06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_operations.py index e45aa63cc7fb5..b38fc5c6e5f1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_service_providers_operations.py index 4888c8089a2dc..98fdd33aad38f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policies_operations.py index 741dc9678e844..0ef43b6997460 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py index 15141cef90760..7df94be77e7b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleCollectionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_collection_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleCollectionGroup": + ) -> "_models.FirewallPolicyRuleCollectionGroup": """Gets the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FirewallPolicyRuleCollectionGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, - parameters: "models.FirewallPolicyRuleCollectionGroup", + parameters: "_models.FirewallPolicyRuleCollectionGroup", **kwargs - ) -> "models.FirewallPolicyRuleCollectionGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + ) -> "_models.FirewallPolicyRuleCollectionGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, - parameters: "models.FirewallPolicyRuleCollectionGroup", + parameters: "_models.FirewallPolicyRuleCollectionGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleCollectionGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleCollectionGroup"]: """Creates or updates the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleCollectionGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleCollectionGroupListResult"]: """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.FirewallPolicyRuleCollectionGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_flow_logs_operations.py index d2dc5667d1ff9..2f736a9d3d596 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FlowLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> "models.FlowLog": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> AsyncLROPoller["models.FlowLog"]: + ) -> AsyncLROPoller["_models.FlowLog"]: """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,7 +363,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.FlowLogListResult"]: + ) -> AsyncIterable["_models.FlowLogListResult"]: """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -361,7 +375,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -408,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_route_tables_operations.py index 17b470dce9f99..82cc92bfbdeec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class HubRouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - route_table_parameters: "models.HubRouteTable", + route_table_parameters: "_models.HubRouteTable", **kwargs - ) -> "models.HubRouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + ) -> "_models.HubRouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - route_table_parameters: "models.HubRouteTable", + route_table_parameters: "_models.HubRouteTable", **kwargs - ) -> AsyncLROPoller["models.HubRouteTable"]: + ) -> AsyncLROPoller["_models.HubRouteTable"]: """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.HubRouteTable": + ) -> "_models.HubRouteTable": """Retrieves the details of a RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.HubRouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubRouteTablesResult"]: + ) -> AsyncIterable["_models.ListHubRouteTablesResult"]: """Retrieves the details of all RouteTables. :param resource_group_name: The resource group name of the VirtualHub. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListHubRouteTablesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_virtual_network_connections_operations.py index 3d281ef43446f..c1c7847725a2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, connection_name: str, - hub_virtual_network_connection_parameters: "models.HubVirtualNetworkConnection", + hub_virtual_network_connection_parameters: "_models.HubVirtualNetworkConnection", **kwargs - ) -> "models.HubVirtualNetworkConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + ) -> "_models.HubVirtualNetworkConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, connection_name: str, - hub_virtual_network_connection_parameters: "models.HubVirtualNetworkConnection", + hub_virtual_network_connection_parameters: "_models.HubVirtualNetworkConnection", **kwargs - ) -> AsyncLROPoller["models.HubVirtualNetworkConnection"]: + ) -> AsyncLROPoller["_models.HubVirtualNetworkConnection"]: """Creates a hub virtual network connection if it doesn't exist else updates the existing one. :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -266,7 +273,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -286,7 +300,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -300,7 +314,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_inbound_nat_rules_operations.py index 002e00bec6186..754169536d01d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_allocations_operations.py index c13cc3e55d575..8fe71b4dd7992 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpAllocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( ip_allocation_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> "models.IpAllocation": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + ) -> "_models.IpAllocation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> AsyncLROPoller["models.IpAllocation"]: + ) -> AsyncLROPoller["_models.IpAllocation"]: """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_groups_operations.py index 415b68c2f6f84..6fd41687a91c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_backend_address_pools_operations.py index cb3c941ae2fdf..15692526e8373 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,10 +184,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, - parameters: "models.BackendAddressPool", + parameters: "_models.BackendAddressPool", **kwargs - ) -> "models.BackendAddressPool": - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + ) -> "_models.BackendAddressPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,9 +243,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, - parameters: "models.BackendAddressPool", + parameters: "_models.BackendAddressPool", **kwargs - ) -> AsyncLROPoller["models.BackendAddressPool"]: + ) -> AsyncLROPoller["_models.BackendAddressPool"]: """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -268,7 +268,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -294,7 +294,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index fe2b18f4e1ab1..b5fee36e3d58a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 68b8fd0deaab4..f990428d77868 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_network_interfaces_operations.py index 0fba16abac847..23405f82c7da2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_outbound_rules_operations.py index 5d1aa088b4ec8..5a0e61a0fe4d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_probes_operations.py index 6645c10c026be..bfc672ce7a322 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancers_operations.py index f6d6ec46dfd67..e2766b474e20a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_local_network_gateways_operations.py index 98e15791cc4ef..b673fd4cdde04 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_nat_gateways_operations.py index 6411e32841f87..cdb5a20c9db66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> "_models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +349,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +491,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_ip_configurations_operations.py index 55ef45abb91b2..de1d82181a94e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_load_balancers_operations.py index 3cb6b9cd8489d..fbaa53c280148 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_tap_configurations_operations.py index d361e340d91c9..0fa1f3636939e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interfaces_operations.py index cdc8f332ce6c9..488d2352bd6c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_management_client_operations.py index 829fa810c81cf..db8ee524fc10f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_05_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_profiles_operations.py index 77bf9de5a8263..e8d813b6756e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_security_groups_operations.py index b5dd4ee7808a3..ef7d76b4927d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_virtual_appliances_operations.py index 986bf6e20ac0b..6eda53107dd2c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkVirtualAppliancesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_virtual_appliance_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def update_tags( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -228,7 +234,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + ) -> "_models.NetworkVirtualAppliance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,9 +341,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: + ) -> AsyncLROPoller["_models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -382,7 +388,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -400,7 +412,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_watchers_operations.py index 6b17795bac2fd..be53b3760e1eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2020_05_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1620,7 +1674,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1699,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1663,10 +1723,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1702,7 +1762,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1721,9 +1781,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1744,7 +1804,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1769,7 +1829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1787,10 +1853,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1826,7 +1892,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1845,9 +1911,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1871,7 +1937,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_operations.py index 599023fce961e..1f998902de8cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_p2_svpn_gateways_operations.py index b38a579e31d1f..d567b3dd32460 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -245,7 +251,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -379,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,7 +409,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -407,7 +419,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +486,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,10 +545,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,9 +600,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -636,7 +648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +673,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -723,7 +741,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,10 +789,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,9 +844,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -843,7 +867,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -868,7 +892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -886,7 +916,7 @@ async def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -936,7 +966,7 @@ async def begin_disconnect_p2_s_vpn_connections( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource @@ -981,7 +1011,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_packet_captures_operations.py index 1dd7afb0886e2..eeb459428c64e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_peer_express_route_circuit_connections_operations.py index fd910c33dbb98..e541f792cda2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_dns_zone_groups_operations.py index 85b15dfe101f4..d66766dc59dfd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateDnsZoneGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs - ) -> "models.PrivateDnsZoneGroup": + ) -> "_models.PrivateDnsZoneGroup": """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> "models.PrivateDnsZoneGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + ) -> "_models.PrivateDnsZoneGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> AsyncLROPoller["models.PrivateDnsZoneGroup"]: + ) -> AsyncLROPoller["_models.PrivateDnsZoneGroup"]: """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( private_endpoint_name: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateDnsZoneGroupListResult"]: + ) -> AsyncIterable["_models.PrivateDnsZoneGroupListResult"]: """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +420,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_endpoints_operations.py index ee0fe71b231c9..1f1b5933960f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_link_services_operations.py index 4c88dd4b7c35a..28b423e353067 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_addresses_operations.py index 7f222337f57a5..e280bca599e30 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_prefixes_operations.py index 668c9466f4377..88c0956342023 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_resource_navigation_links_operations.py index 0c6013701334d..6ab00d55d9f4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filter_rules_operations.py index 717b308ddba67..f3eb4e2898659 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filters_operations.py index 787c27852be90..a2bf7e38a8a3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_tables_operations.py index 9052d30c90beb..a5ef391de33de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_routes_operations.py index d2d17777defd4..0904da0dd19f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_partner_providers_operations.py index 6b1d11606bbfb..acdfdb0ba08b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityPartnerProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, security_partner_provider_name: str, **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> "models.SecurityPartnerProvider": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + ) -> "_models.SecurityPartnerProvider": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> AsyncLROPoller["models.SecurityPartnerProvider"]: + ) -> AsyncLROPoller["_models.SecurityPartnerProvider"]: """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +477,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -473,7 +485,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_rules_operations.py index 0631226e7eda8..93c25a8601846 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_association_links_operations.py index 88ef6551ccd88..44b6c821c4418 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policies_operations.py index 85beebc12f3bb..ea729c592297f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 18366216faa64..63b81f7a6c7e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_tags_operations.py index 9263e95bf57ee..8bdb27c608f0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_subnets_operations.py index 1872befa285c2..cc64dcf0ab37d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_usages_operations.py index b6439354d09bd..3b7dc5145974c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_sites_operations.py index 66f2100990cea..3dd573d11aaa0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualApplianceSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_virtual_appliance_name: str, site_name: str, **kwargs - ) -> "models.VirtualApplianceSite": + ) -> "_models.VirtualApplianceSite": """Gets the specified Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualApplianceSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_virtual_appliance_name: str, site_name: str, - parameters: "models.VirtualApplianceSite", + parameters: "_models.VirtualApplianceSite", **kwargs - ) -> "models.VirtualApplianceSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + ) -> "_models.VirtualApplianceSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_virtual_appliance_name: str, site_name: str, - parameters: "models.VirtualApplianceSite", + parameters: "_models.VirtualApplianceSite", **kwargs - ) -> AsyncLROPoller["models.VirtualApplianceSite"]: + ) -> AsyncLROPoller["_models.VirtualApplianceSite"]: """Creates or updates the specified Network Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_virtual_appliance_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceSiteListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceSiteListResult"]: """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceSiteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSiteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_skus_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_skus_operations.py index e7301e52417e9..4f12b790c94d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_skus_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_appliance_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualApplianceSkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceSkuListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceSkuListResult"]: """List all SKUs available for a virtual appliance. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def get( self, sku_name: str, **kwargs - ) -> "models.NetworkVirtualApplianceSku": + ) -> "_models.NetworkVirtualApplianceSku": """Retrieves a single available sku for network virtual appliance. :param sku_name: Name of the Sku. @@ -121,7 +121,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceSku :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connection_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connection_operations.py index 7c87c09823195..173b0eff5e5e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connection_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connection_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualHubBgpConnectionOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.BgpConnection": + ) -> "_models.BgpConnection": """Retrieves the details of a Virtual Hub Bgp Connection. :param resource_group_name: The resource group name of the VirtualHub. @@ -62,7 +62,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.BgpConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, connection_name: str, - parameters: "models.BgpConnection", + parameters: "_models.BgpConnection", **kwargs - ) -> "models.BgpConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + ) -> "_models.BgpConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,9 +168,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, connection_name: str, - parameters: "models.BgpConnection", + parameters: "_models.BgpConnection", **kwargs - ) -> AsyncLROPoller["models.BgpConnection"]: + ) -> AsyncLROPoller["_models.BgpConnection"]: """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. @@ -193,7 +193,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connections_operations.py index 9a3807f72ad7f..2a3b0e062f660 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_bgp_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualHubBgpConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubBgpConnectionResults"]: + ) -> AsyncIterable["_models.ListVirtualHubBgpConnectionResults"]: """Retrieves the details of all VirtualHubBgpConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubBgpConnectionResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubBgpConnectionResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_ip_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_ip_configuration_operations.py index defcc30f2ed3d..a808501fca0fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_ip_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_ip_configuration_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubIpConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, ip_config_name: str, **kwargs - ) -> "models.HubIpConfiguration": + ) -> "_models.HubIpConfiguration": """Retrieves the details of a Virtual Hub Ip configuration. :param resource_group_name: The resource group name of the VirtualHub. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.HubIpConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, ip_config_name: str, - parameters: "models.HubIpConfiguration", + parameters: "_models.HubIpConfiguration", **kwargs - ) -> "models.HubIpConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + ) -> "_models.HubIpConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, ip_config_name: str, - parameters: "models.HubIpConfiguration", + parameters: "_models.HubIpConfiguration", **kwargs - ) -> AsyncLROPoller["models.HubIpConfiguration"]: + ) -> AsyncLROPoller["_models.HubIpConfiguration"]: """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubIpConfigurationResults"]: + ) -> AsyncIterable["_models.ListVirtualHubIpConfigurationResults"]: """Retrieves the details of all VirtualHubIpConfigurations. :param resource_group_name: The resource group name of the VirtualHub. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubIpConfigurationResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubIpConfigurationResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index aaa25b92c44bd..200f4e37a8d6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hubs_operations.py index d5e796e7f7e0f..a08b3ff3d58e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ async def _get_effective_virtual_hub_routes_initial( self, resource_group_name: str, virtual_hub_name: str, - effective_routes_parameters: Optional["models.EffectiveRoutesParameters"] = None, + effective_routes_parameters: Optional["_models.EffectiveRoutesParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -584,7 +596,7 @@ async def begin_get_effective_virtual_hub_routes( self, resource_group_name: str, virtual_hub_name: str, - effective_routes_parameters: Optional["models.EffectiveRoutesParameters"] = None, + effective_routes_parameters: Optional["_models.EffectiveRoutesParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Gets the effective routes configured for the Virtual Hub resource or the specified resource . @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateway_connections_operations.py index d89abe40ef48a..6c4bae6eb18b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2020_05_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateways_operations.py index 1a49374a2415f..62b1938299c34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2229,7 +2325,7 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2279,7 +2375,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. @@ -2323,7 +2419,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_peerings_operations.py index b2ff8669c7bb5..ebb5bb5812958 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_taps_operations.py index 053e0c1c358b8..050ae896663c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_networks_operations.py index 457d5d7f01aa8..b54824809ce3a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_05_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -673,7 +685,7 @@ async def get_bastion_hosts( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> "models.BastionHostListResult": + ) -> "_models.BastionHostListResult": """Get a list of bastion hosts accessible from the given network. :param resource_group_name: The name of the resource group. @@ -685,7 +697,7 @@ async def get_bastion_hosts( :rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHostListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_router_peerings_operations.py index ba5f3848e051d..53840aacf8c4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_routers_operations.py index cc5ee954ba6df..db3bedc50e56f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_wans_operations.py index 8bc3bca6f4c51..ed5af01a4833b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_connections_operations.py index 0806f1ab0fb31..f2ec22b17b602 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -359,7 +373,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_gateways_operations.py index 52e5c34213092..d6aa53be94810 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,9 +234,9 @@ async def update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -244,7 +250,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +384,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -397,8 +409,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -446,7 +458,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,7 +476,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -488,7 +500,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -506,7 +524,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -516,7 +534,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -575,7 +593,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +601,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_link_connections_operations.py index 8aed32e8bb1e3..43d6dd214508c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 5207f79f4effc..530ef0173957e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_operations.py index 16304e78eb2a5..c07b63a8f9d35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_link_connections_operations.py index 878198fa00364..56fabc1beda61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_links_operations.py index 9b7a7f0985d0c..6c9e2286a5a48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_configuration_operations.py index b85599081af4d..e69a166bfdc92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_operations.py index 04ef98ab5a9db..d5c78149eaaf8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_web_application_firewall_policies_operations.py index 7402dc72b3e54..18abddd4b3048 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_endpoint_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_endpoint_connections_operations.py index 1315bf72dc5a3..e1c208d8e0011 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_endpoint_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_endpoint_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewayPrivateEndpointConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,11 +169,11 @@ def _update_initial( resource_group_name, # type: str application_gateway_name, # type: str connection_name, # type: str - parameters, # type: "models.ApplicationGatewayPrivateEndpointConnection" + parameters, # type: "_models.ApplicationGatewayPrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayPrivateEndpointConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayPrivateEndpointConnection"]] + # type: (...) -> Optional["_models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayPrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ def begin_update( resource_group_name, # type: str application_gateway_name, # type: str connection_name, # type: str - parameters, # type: "models.ApplicationGatewayPrivateEndpointConnection" + parameters, # type: "_models.ApplicationGatewayPrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayPrivateEndpointConnection"] + # type: (...) -> LROPoller["_models.ApplicationGatewayPrivateEndpointConnection"] """Updates the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -272,7 +279,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -293,7 +307,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayPrivateEndpointConnection" + # type: (...) -> "_models.ApplicationGatewayPrivateEndpointConnection" """Gets the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -307,7 +321,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +369,7 @@ def list( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] """Lists all private endpoint connections on an application gateway. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_link_resources_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_link_resources_operations.py index fede9eafa7002..452c12adaa053 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_link_resources_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_link_resources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ApplicationGatewayPrivateLinkResourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayPrivateLinkResourceListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayPrivateLinkResourceListResult"] """Lists all private link resources on an application gateway. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py index 5a44bb93e76ed..d4884c81a0be0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_security_groups_operations.py index 82b5b6c96fe3e..886ec51c1a5e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py index 975506072b1d6..02cab9b1a8b7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_endpoint_services_operations.py index db55017af4520..7ef6887d64cc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_private_endpoint_types_operations.py index f53fc66d346c1..1b337ecb6d357 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_resource_group_delegations_operations.py index 97ce807735872..c2d4c90385bd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_service_aliases_operations.py index cae59146cae73..eaad3080d9050 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewall_fqdn_tags_operations.py index afc4d7ba9220f..2235b26620ffd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py index 2db515d30d7ba..0a51304392998 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.AzureFirewall"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + # type: (...) -> Optional["_models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -539,7 +557,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py index 8766a0c62a6e5..a76f4d4ccf351 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bgp_service_communities_operations.py index 491b8a4f349ca..b94518d97bcef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py index 29dc56644295a..1b091d7816507 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_custom_policies_operations.py index cbf304e07e914..998220c504c2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_protection_plans_operations.py index 526257d1f14c6..64ac5b34ebc8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_default_security_rules_operations.py index 2d40a7bb7b4ce..acaadb35887e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_authorizations_operations.py index 5cc4ccc3b1231..7c766e0855520 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_connections_operations.py index bed8105d0d670..b905a83639620 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_peerings_operations.py index e8ca846861cae..139078dcf578a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuits_operations.py index fd4728d740553..8e45027b19f43 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_connections_operations.py index e4fcb97e17303..497d5eeb286c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connection_peerings_operations.py index cbe7da3466fc2..3d4b83a822373 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connections_operations.py index 02eef01073e9b..6e52b1f0d04be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_gateways_operations.py index 6b4eebf1582f0..bcab8f3b31c5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_links_operations.py index 5f0a0c20262fa..656ffe0a1780c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_locations_operations.py index e77fb64d476a5..72e017d1970ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_operations.py index 0e2a26bf61016..7ea3868418915 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_service_providers_operations.py index 884cd899721ef..4e51e1a904d97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py index 8c4f44d4444ec..efa0e31af246a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policy_rule_collection_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policy_rule_collection_groups_operations.py index 2dee93308947b..8b51eb4bfd766 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policy_rule_collection_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policy_rule_collection_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleCollectionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_collection_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleCollectionGroup" + # type: (...) -> "_models.FirewallPolicyRuleCollectionGroup" """Gets the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FirewallPolicyRuleCollectionGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_collection_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleCollectionGroup" + parameters, # type: "_models.FirewallPolicyRuleCollectionGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleCollectionGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + # type: (...) -> "_models.FirewallPolicyRuleCollectionGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_collection_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleCollectionGroup" + parameters, # type: "_models.FirewallPolicyRuleCollectionGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleCollectionGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleCollectionGroup"] """Creates or updates the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleCollectionGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleCollectionGroupListResult"] """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.FirewallPolicyRuleCollectionGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py index f8caccc09e3fb..c4ec8a3d8078e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FlowLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLog"] + # type: (...) -> LROPoller["_models.FlowLog"] """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -359,7 +373,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FlowLogListResult"] + # type: (...) -> Iterable["_models.FlowLogListResult"] """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -371,7 +385,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_route_tables_operations.py index 0ccfb4d726cf6..8db9ba3624f05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class HubRouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - route_table_parameters, # type: "models.HubRouteTable" + route_table_parameters, # type: "_models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> "models.HubRouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + # type: (...) -> "_models.HubRouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - route_table_parameters, # type: "models.HubRouteTable" + route_table_parameters, # type: "_models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubRouteTable"] + # type: (...) -> LROPoller["_models.HubRouteTable"] """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubRouteTable" + # type: (...) -> "_models.HubRouteTable" """Retrieves the details of a RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.HubRouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubRouteTablesResult"] + # type: (...) -> Iterable["_models.ListHubRouteTablesResult"] """Retrieves the details of all RouteTables. :param resource_group_name: The resource group name of the VirtualHub. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListHubRouteTablesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_virtual_network_connections_operations.py index 90a1234645517..1e009d08d65d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_virtual_network_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - hub_virtual_network_connection_parameters, # type: "models.HubVirtualNetworkConnection" + hub_virtual_network_connection_parameters, # type: "_models.HubVirtualNetworkConnection" **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + # type: (...) -> "_models.HubVirtualNetworkConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - hub_virtual_network_connection_parameters, # type: "models.HubVirtualNetworkConnection" + hub_virtual_network_connection_parameters, # type: "_models.HubVirtualNetworkConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubVirtualNetworkConnection"] + # type: (...) -> LROPoller["_models.HubVirtualNetworkConnection"] """Creates a hub virtual network connection if it doesn't exist else updates the existing one. :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -274,7 +281,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -295,7 +309,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +323,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +371,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_inbound_nat_rules_operations.py index c590946aab2dc..015d969387704 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py index dddbc42f52c5e..8b4772354b657 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpAllocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + # type: (...) -> "_models.IpAllocation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpAllocation"] + # type: (...) -> LROPoller["_models.IpAllocation"] """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py index a2cf1d49dbe6e..59668b00b1c7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2020_05_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_backend_address_pools_operations.py index 7cd044e407442..ad70717f08bb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_backend_address_pools_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -129,7 +129,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,11 +190,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str backend_address_pool_name, # type: str - parameters, # type: "models.BackendAddressPool" + parameters, # type: "_models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + # type: (...) -> "_models.BackendAddressPool" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -250,10 +250,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str backend_address_pool_name, # type: str - parameters, # type: "models.BackendAddressPool" + parameters, # type: "_models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BackendAddressPool"] + # type: (...) -> LROPoller["_models.BackendAddressPool"] """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -276,7 +276,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -302,7 +302,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_frontend_ip_configurations_operations.py index e910c1fb64a1c..ec926b7071f41 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_load_balancing_rules_operations.py index 3bb1677746d4f..7a6bc45ea6da5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_network_interfaces_operations.py index 00b22d2c88aab..0fed90ff6c0f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_outbound_rules_operations.py index 49a1eb05ee308..f82dec78b28f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_probes_operations.py index 030e8eb4b7ccf..7fa2804d8ec32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py index 230ffb308f20b..4abd1fe90414f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_local_network_gateways_operations.py index c9dc9d090730b..5fa778a05f8ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py index 306030693f4a6..6a62334729691 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> "_models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +358,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +375,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_ip_configurations_operations.py index 7aa3a874e5afe..9ccb5ca966556 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_load_balancers_operations.py index 4e8c2fabf6d11..3d87fa224f96f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_tap_configurations_operations.py index b6c51538eaf59..8806ef8730933 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_operations.py index f2a6c07097ef9..10cd752df1d41 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_management_client_operations.py index 3f3bad89de189..544d5d8a98343 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_05_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py index 7a341dc5f12de..db1cf76721b85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_security_groups_operations.py index 749532593d6d4..eace5a08999f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_virtual_appliances_operations.py index 3b7b5596193f0..9b2b22fa6ab69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkVirtualAppliancesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def update_tags( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -236,7 +242,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -286,11 +292,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + # type: (...) -> "_models.NetworkVirtualAppliance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,10 +350,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] + # type: (...) -> LROPoller["_models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -392,7 +398,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -411,7 +423,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py index 4863b68dbbb49..caf22afc8992f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2020_05_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1650,7 +1704,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1675,7 +1729,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1693,11 +1753,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1733,7 +1793,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1752,10 +1812,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1776,7 +1836,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1801,7 +1861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1819,11 +1885,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1859,7 +1925,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1878,10 +1944,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1905,7 +1971,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1930,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py index f42d1f6e8926b..8eaffd565bf23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_p2_svpn_gateways_operations.py index 25f5b9a1b0493..b5fb40bb23307 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -253,7 +259,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -389,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,7 +420,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,7 +430,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +498,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,11 +557,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,10 +613,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -650,7 +662,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -670,8 +688,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -739,7 +757,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -781,11 +805,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,10 +861,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -861,7 +885,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -886,7 +910,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -904,7 +934,7 @@ def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -955,7 +985,7 @@ def begin_disconnect_p2_s_vpn_connections( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1001,7 +1031,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py index 1fcfa42b5d1aa..4abec8fe5d19e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_peer_express_route_circuit_connections_operations.py index 6b759d81ab6c2..0da36d877f16a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_dns_zone_groups_operations.py index 1776577226350..7fc96b1fd760c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateDnsZoneGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( private_dns_zone_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" + # type: (...) -> "_models.PrivateDnsZoneGroup" """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + # type: (...) -> "_models.PrivateDnsZoneGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateDnsZoneGroup"] + # type: (...) -> LROPoller["_models.PrivateDnsZoneGroup"] """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateDnsZoneGroupListResult"] + # type: (...) -> Iterable["_models.PrivateDnsZoneGroupListResult"] """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +430,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py index 652bcb703a2ea..371e60f53215d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_link_services_operations.py index ceeda0a76a6f8..d1f82be12650e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_05_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_addresses_operations.py index 848bc899a87b9..5e05f1dbe667f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_prefixes_operations.py index 93b617db8b489..537501ce0ea9f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_resource_navigation_links_operations.py index ef19997e7e4a0..2880ad5d474a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filter_rules_operations.py index ba420a1c88201..64c95246d17f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py index 2c8c173d7c34d..66fc165fe8a3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py index 0d3ae91aeb7d6..617ba1cf49eb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_operations.py index fdbfb7607d00e..d47a7c6dd59be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_partner_providers_operations.py index bd510eeaa5ca9..239873400c7ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityPartnerProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( security_partner_provider_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + # type: (...) -> "_models.SecurityPartnerProvider" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityPartnerProvider"] + # type: (...) -> LROPoller["_models.SecurityPartnerProvider"] """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,7 +489,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -485,7 +497,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py index caaf3350b56db..53c3fa0dd594a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_association_links_operations.py index 984eacf6289f3..68d941ad4e3be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policies_operations.py index 788a551a69220..799aeb70747e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policy_definitions_operations.py index 8cdbde9932a19..a2b8a4d45fb01 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py index fb036a21f04e6..c35c4437fb729 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_05_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py index 37c189529221d..d2f0e09f315f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py index 41e73d62d7963..da2a70668798b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_sites_operations.py index b60e45d6ece91..78cea5e8cefff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualApplianceSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualApplianceSite" + # type: (...) -> "_models.VirtualApplianceSite" """Gets the specified Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualApplianceSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_virtual_appliance_name, # type: str site_name, # type: str - parameters, # type: "models.VirtualApplianceSite" + parameters, # type: "_models.VirtualApplianceSite" **kwargs # type: Any ): - # type: (...) -> "models.VirtualApplianceSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + # type: (...) -> "_models.VirtualApplianceSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_virtual_appliance_name, # type: str site_name, # type: str - parameters, # type: "models.VirtualApplianceSite" + parameters, # type: "_models.VirtualApplianceSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualApplianceSite"] + # type: (...) -> LROPoller["_models.VirtualApplianceSite"] """Creates or updates the specified Network Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_virtual_appliance_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceSiteListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceSiteListResult"] """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceSiteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSiteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_skus_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_skus_operations.py index 80b7aec7c4dda..d8cd3307a191f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_skus_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualApplianceSkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceSkuListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceSkuListResult"] """List all SKUs available for a virtual appliance. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def get( sku_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualApplianceSku" + # type: (...) -> "_models.NetworkVirtualApplianceSku" """Retrieves a single available sku for network virtual appliance. :param sku_name: Name of the Sku. @@ -127,7 +127,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.NetworkVirtualApplianceSku :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connection_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connection_operations.py index 21eb64850af06..1fe16c5552e2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connection_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connection_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualHubBgpConnectionOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BgpConnection" + # type: (...) -> "_models.BgpConnection" """Retrieves the details of a Virtual Hub Bgp Connection. :param resource_group_name: The resource group name of the VirtualHub. @@ -67,7 +67,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.BgpConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,11 +114,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - parameters, # type: "models.BgpConnection" + parameters, # type: "_models.BgpConnection" **kwargs # type: Any ): - # type: (...) -> "models.BgpConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + # type: (...) -> "_models.BgpConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,10 +174,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - parameters, # type: "models.BgpConnection" + parameters, # type: "_models.BgpConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpConnection"] + # type: (...) -> LROPoller["_models.BgpConnection"] """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. @@ -200,7 +200,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -226,7 +226,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connections_operations.py index ad587837970f4..ad8f1e0a1596d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualHubBgpConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubBgpConnectionResults"] + # type: (...) -> Iterable["_models.ListVirtualHubBgpConnectionResults"] """Retrieves the details of all VirtualHubBgpConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubBgpConnectionResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubBgpConnectionResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_ip_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_ip_configuration_operations.py index e9095cd017db6..54659ca94567c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_ip_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_ip_configuration_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubIpConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( ip_config_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubIpConfiguration" + # type: (...) -> "_models.HubIpConfiguration" """Retrieves the details of a Virtual Hub Ip configuration. :param resource_group_name: The resource group name of the VirtualHub. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.HubIpConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str ip_config_name, # type: str - parameters, # type: "models.HubIpConfiguration" + parameters, # type: "_models.HubIpConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.HubIpConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + # type: (...) -> "_models.HubIpConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str ip_config_name, # type: str - parameters, # type: "models.HubIpConfiguration" + parameters, # type: "_models.HubIpConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubIpConfiguration"] + # type: (...) -> LROPoller["_models.HubIpConfiguration"] """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubIpConfigurationResults"] + # type: (...) -> Iterable["_models.ListVirtualHubIpConfigurationResults"] """Retrieves the details of all VirtualHubIpConfigurations. :param resource_group_name: The resource group name of the VirtualHub. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubIpConfigurationResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubIpConfigurationResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_route_table_v2_s_operations.py index 890810afeb921..a92525d099aca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py index 96bfd5c3d1d8c..f45b8c24176f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +555,7 @@ def _get_effective_virtual_hub_routes_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - effective_routes_parameters=None, # type: Optional["models.EffectiveRoutesParameters"] + effective_routes_parameters=None, # type: Optional["_models.EffectiveRoutesParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -597,7 +609,7 @@ def begin_get_effective_virtual_hub_routes( self, resource_group_name, # type: str virtual_hub_name, # type: str - effective_routes_parameters=None, # type: Optional["models.EffectiveRoutesParameters"] + effective_routes_parameters=None, # type: Optional["_models.EffectiveRoutesParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -643,7 +655,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateway_connections_operations.py index 3871efb43994d..e21fa364a189a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2020_05_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py index 253588bd1132d..aa8f23b402755 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2270,7 +2366,7 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -2321,7 +2417,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2366,7 +2462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_peerings_operations.py index 748defb18db30..3d8281f6a8ebc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_taps_operations.py index 6b4a71a3ddb3c..2f88d24a12c97 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py index fec4008c11a45..ddf3646889106 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_05_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -688,7 +700,7 @@ def get_bastion_hosts( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHostListResult" + # type: (...) -> "_models.BastionHostListResult" """Get a list of bastion hosts accessible from the given network. :param resource_group_name: The name of the resource group. @@ -700,7 +712,7 @@ def get_bastion_hosts( :rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHostListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_router_peerings_operations.py index 7ea6d2ae075b8..a986b1dd4aaf0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py index 23e70d98122a9..0b78be1e5f195 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py index bbd0bf9115b9e..84f1dc4786fc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py index aee6d88d3115e..a391f43d8be95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -369,7 +383,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py index c24d055a2f811..b5d07c6a74700 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,10 +241,10 @@ def update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -252,7 +258,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,7 +394,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -408,8 +420,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,7 +470,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -476,7 +488,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -519,7 +537,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -529,7 +547,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +607,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -597,7 +615,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_link_connections_operations.py index 62c714a782efc..4fa6895e47ad2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index f9efb0f133b34..4316e12bec0e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_operations.py index bc3d7f4c41b29..e50e4c2c776d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_link_connections_operations.py index ca86a9bc47fa1..9354c202c95c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_links_operations.py index af3427da46ad1..078205cfb8ca6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_configuration_operations.py index 58e6388ff57e6..241de2a584446 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py index 6d05e4aba0b3c..ae5c91d2f2527 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_05_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_web_application_firewall_policies_operations.py index c404b9850f2a0..ab6ef8b096993 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json index f4b6288cb036d..a3975934f7737 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -159,60 +160,60 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_put_bastion_shareable_link" : { "sync": { - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionShareableLinkListResult\"]]:\n", + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "_delete_bastion_shareable_link_initial" : { "sync": { - "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "begin_delete_bastion_shareable_link" : { "sync": { - "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" }, "get_bastion_shareable_link" : { "sync": { - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionShareableLinkListResult\"]:\n", + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, bsl_request" @@ -224,7 +225,7 @@ }, "async": { "coroutine": true, - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"models.BastionActiveSessionListResult\"]:\n", + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" @@ -236,19 +237,19 @@ }, "async": { "coroutine": false, - "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.BastionActiveSessionListResult\"]]:\n", + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, bastion_host_name" }, "disconnect_active_sessions" : { "sync": { - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"models.SessionIds\"\n **kwargs # type: Any\n):\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_06_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"models.BastionSessionDeleteResult\"]:\n", + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_06_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, bastion_host_name, session_ids" @@ -260,7 +261,7 @@ }, "async": { "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "location, domain_name_label" @@ -272,31 +273,31 @@ }, "async": { "coroutine": true, - "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"models.VirtualWanSecurityProviders\":\n", + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name" }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_06_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"models.VpnProfileResponse\"]:\n", + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_06_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" }, "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_06_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"models.VpnProfileResponse\"]:\n", + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_06_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "resource_group_name, virtual_wan_name, vpn_client_params" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py index 2b386eac147c0..897421227dd28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py @@ -360,7 +360,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client.py index a6cb69d079bc2..3dd7180f5911b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client.py @@ -357,7 +357,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.application_gateways = ApplicationGatewaysOperations( diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py index 30db91ebe4cd9..12d8ba2c32da1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewayPrivateEndpointConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -156,10 +163,10 @@ async def _update_initial( resource_group_name: str, application_gateway_name: str, connection_name: str, - parameters: "models.ApplicationGatewayPrivateEndpointConnection", + parameters: "_models.ApplicationGatewayPrivateEndpointConnection", **kwargs - ) -> Optional["models.ApplicationGatewayPrivateEndpointConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayPrivateEndpointConnection"]] + ) -> Optional["_models.ApplicationGatewayPrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayPrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +220,9 @@ async def begin_update( resource_group_name: str, application_gateway_name: str, connection_name: str, - parameters: "models.ApplicationGatewayPrivateEndpointConnection", + parameters: "_models.ApplicationGatewayPrivateEndpointConnection", **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayPrivateEndpointConnection"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayPrivateEndpointConnection"]: """Updates the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -238,7 +245,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -264,7 +271,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -284,7 +298,7 @@ async def get( application_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ApplicationGatewayPrivateEndpointConnection": + ) -> "_models.ApplicationGatewayPrivateEndpointConnection": """Gets the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -298,7 +312,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -345,7 +359,7 @@ def list( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayPrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayPrivateEndpointConnectionListResult"]: """Lists all private endpoint connections on an application gateway. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_link_resources_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_link_resources_operations.py index 88ae11e696c35..44ffa54a591d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_link_resources_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateway_private_link_resources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ApplicationGatewayPrivateLinkResourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayPrivateLinkResourceListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayPrivateLinkResourceListResult"]: """Lists all private link resources on an application gateway. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateways_operations.py index 96bc75a4a6f2f..44985d749ca5b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.ApplicationGateway", + parameters: "_models.ApplicationGateway", **kwargs - ) -> AsyncLROPoller["models.ApplicationGateway"]: + ) -> AsyncLROPoller["_models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, application_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> "_models.ApplicationGateway": """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayListResult"]: + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -717,7 +735,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -737,8 +761,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -789,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealth"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -809,7 +833,7 @@ async def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -834,7 +858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -852,11 +882,11 @@ async def _backend_health_on_demand_initial( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -910,10 +940,10 @@ async def begin_backend_health_on_demand( self, resource_group_name: str, application_gateway_name: str, - probe_request: "models.ApplicationGatewayOnDemandProbe", + probe_request: "_models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.ApplicationGatewayBackendHealthOnDemand"]: + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -936,7 +966,7 @@ async def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +992,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1016,7 +1052,7 @@ async def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1067,7 +1103,7 @@ async def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1118,7 +1154,7 @@ async def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1132,7 +1168,7 @@ async def list_available_response_headers( async def list_available_waf_rule_sets( self, **kwargs - ) -> "models.ApplicationGatewayAvailableWafRuleSetsResult": + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1140,7 +1176,7 @@ async def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1218,7 @@ async def list_available_waf_rule_sets( async def list_available_ssl_options( self, **kwargs - ) -> "models.ApplicationGatewayAvailableSslOptions": + ) -> "_models.ApplicationGatewayAvailableSslOptions": """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1190,7 +1226,7 @@ async def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1232,7 +1268,7 @@ async def list_available_ssl_options( def list_available_ssl_predefined_policies( self, **kwargs - ) -> AsyncIterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1240,7 +1276,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1299,7 +1335,7 @@ async def get_ssl_predefined_policy( self, predefined_policy_name: str, **kwargs - ) -> "models.ApplicationGatewaySslPredefinedPolicy": + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1309,7 +1345,7 @@ async def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_security_groups_operations.py index 692bdd69c9926..b3f22f55e5e98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ApplicationSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.ApplicationSecurityGroup", + parameters: "_models.ApplicationSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, application_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> "_models.ApplicationSecurityGroup": """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -403,7 +415,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +474,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ApplicationSecurityGroupListResult"]: + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_delegations_operations.py index de755d8117ac9..1713a1c6e7ecc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_endpoint_services_operations.py index 41f0421ddfa0f..9276e7aff5bf2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableEndpointServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.EndpointServicesListResult"]: + ) -> AsyncIterable["_models.EndpointServicesListResult"]: """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_private_endpoint_types_operations.py index d737080f85cc2..d9875d5fe29d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailablePrivateEndpointTypesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailablePrivateEndpointTypesResult"]: + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -130,7 +130,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_resource_group_delegations_operations.py index 1e6f2f52d7768..8119d7e03e4d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableResourceGroupDelegationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailableDelegationsResult"]: + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_service_aliases_operations.py index 24d32d97ea6a0..0618f5792f9a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailableServiceAliasesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_resource_group( resource_group_name: str, location: str, **kwargs - ) -> AsyncIterable["models.AvailableServiceAliasesResult"]: + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py index 692d87d0605ec..da9fbfa08d409 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AzureFirewallFqdnTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallFqdnTagListResult"]: + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewalls_operations.py index ecf30a4f680c2..2522a26019446 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class AzureFirewallsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> "models.AzureFirewall": + ) -> "_models.AzureFirewall": """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.AzureFirewall", + parameters: "_models.AzureFirewall", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.AzureFirewall"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + ) -> Optional["_models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, azure_firewall_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.AzureFirewall"]: + ) -> AsyncLROPoller["_models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +536,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.AzureFirewallListResult"]: + ) -> AsyncIterable["_models.AzureFirewallListResult"]: """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -526,7 +544,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bastion_hosts_operations.py index 21c048d46bafe..f2f25a1d38832 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class BastionHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionHost": + ) -> "_models.BastionHost": """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> "models.BastionHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, bastion_host_name: str, - parameters: "models.BastionHost", + parameters: "_models.BastionHost", **kwargs - ) -> AsyncLROPoller["models.BastionHost"]: + ) -> AsyncLROPoller["_models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +340,7 @@ def get_long_running_output(pipeline_response): def list( self, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -336,7 +348,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.BastionHostListResult"]: + ) -> AsyncIterable["_models.BastionHostListResult"]: """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bgp_service_communities_operations.py index 4f07f2f336549..c51c63c84e5bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BgpServiceCommunitiesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.BgpServiceCommunityListResult"]: + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_connection_monitors_operations.py index 14654596271a0..d4166f23b1336 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ConnectionMonitorsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.ConnectionMonitor", + parameters: "_models.ConnectionMonitor", **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -178,7 +185,7 @@ async def get( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -192,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -274,7 +281,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +337,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -349,9 +363,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, connection_monitor_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> "_models.ConnectionMonitorResult": """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -404,7 +418,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -454,7 +468,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -510,7 +524,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -563,7 +584,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -619,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,8 +667,8 @@ async def _query_initial( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "models.ConnectionMonitorQueryResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,7 +700,7 @@ async def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -693,7 +721,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> AsyncLROPoller["models.ConnectionMonitorQueryResult"]: + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -713,7 +741,7 @@ async def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +766,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -757,7 +792,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.ConnectionMonitorListResult"]: + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -816,7 +851,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_custom_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_custom_ip_prefixes_operations.py index 4cbbbf93045c5..3e3628ecf50f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_custom_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_custom_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class CustomIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( custom_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.CustomIpPrefix": + ) -> "_models.CustomIpPrefix": """Gets the specified custom IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.CustomIpPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, custom_ip_prefix_name: str, - parameters: "models.CustomIpPrefix", + parameters: "_models.CustomIpPrefix", **kwargs - ) -> "models.CustomIpPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + ) -> "_models.CustomIpPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, custom_ip_prefix_name: str, - parameters: "models.CustomIpPrefix", + parameters: "_models.CustomIpPrefix", **kwargs - ) -> AsyncLROPoller["models.CustomIpPrefix"]: + ) -> AsyncLROPoller["_models.CustomIpPrefix"]: """Creates or updates a custom IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, custom_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.CustomIpPrefix": + ) -> "_models.CustomIpPrefix": """Updates custom IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.CustomIpPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.CustomIpPrefixListResult"]: + ) -> AsyncIterable["_models.CustomIpPrefixListResult"]: """Gets all the custom IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.CustomIpPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.CustomIpPrefixListResult"]: + ) -> AsyncIterable["_models.CustomIpPrefixListResult"]: """Gets all custom IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.CustomIpPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_custom_policies_operations.py index ed743bb9aaf13..c82b778e4728a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class DdosCustomPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -130,7 +130,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -149,7 +155,7 @@ async def get( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -161,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +212,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -263,9 +269,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.DdosCustomPolicy", + parameters: "_models.DdosCustomPolicy", **kwargs - ) -> AsyncLROPoller["models.DdosCustomPolicy"]: + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -285,7 +291,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -310,7 +316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,9 +340,9 @@ async def update_tags( self, resource_group_name: str, ddos_custom_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> "_models.DdosCustomPolicy": """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_protection_plans_operations.py index 04ce049c9db63..94f3cb06e2c47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DdosProtectionPlansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.DdosProtectionPlan", + parameters: "_models.DdosProtectionPlan", **kwargs - ) -> AsyncLROPoller["models.DdosProtectionPlan"]: + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, ddos_protection_plan_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> "_models.DdosProtectionPlan": """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DdosProtectionPlanListResult"]: + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_default_security_rules_operations.py index 83be2f089d1e3..cb1a9bb0561bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DefaultSecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_security_group_name: str, default_security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_dscp_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_dscp_configuration_operations.py index 8c6532bd877b9..27c318467f5bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_dscp_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_dscp_configuration_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DscpConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, dscp_configuration_name: str, - parameters: "models.DscpConfiguration", + parameters: "_models.DscpConfiguration", **kwargs - ) -> "models.DscpConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + ) -> "_models.DscpConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, dscp_configuration_name: str, - parameters: "models.DscpConfiguration", + parameters: "_models.DscpConfiguration", **kwargs - ) -> AsyncLROPoller["models.DscpConfiguration"]: + ) -> AsyncLROPoller["_models.DscpConfiguration"]: """Creates or updates a DSCP Configuration. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -253,7 +259,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -272,7 +284,7 @@ async def get( resource_group_name: str, dscp_configuration_name: str, **kwargs - ) -> "models.DscpConfiguration": + ) -> "_models.DscpConfiguration": """Gets a DSCP Configuration. :param resource_group_name: The name of the resource group. @@ -284,7 +296,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.DscpConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -329,7 +341,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DscpConfigurationListResult"]: + ) -> AsyncIterable["_models.DscpConfigurationListResult"]: """Gets a DSCP Configuration. :param resource_group_name: The name of the resource group. @@ -339,7 +351,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.DscpConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,7 +410,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.DscpConfigurationListResult"]: + ) -> AsyncIterable["_models.DscpConfigurationListResult"]: """Gets all dscp configurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -406,7 +418,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.DscpConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_authorizations_operations.py index 429939fd264da..2626bbdf76fe9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitAuthorizationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, authorization_name: str, **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": + ) -> "_models.ExpressRouteCircuitAuthorization": """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, authorization_name: str, - authorization_parameters: "models.ExpressRouteCircuitAuthorization", + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitAuthorization"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationListResult"]: + ) -> AsyncIterable["_models.AuthorizationListResult"]: """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_connections_operations.py index 682dfdabdcf0b..71031920bc8d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -144,7 +144,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -165,7 +173,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteCircuitConnection": + ) -> "_models.ExpressRouteCircuitConnection": """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -181,7 +189,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,10 +238,10 @@ async def _create_or_update_initial( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> "models.ExpressRouteCircuitConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,9 +299,9 @@ async def begin_create_or_update( circuit_name: str, peering_name: str, connection_name: str, - express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -318,7 +326,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -345,7 +353,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -365,7 +381,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: """Gets all global reach connections associated with a private peering in an express route circuit. @@ -380,7 +396,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_peerings_operations.py index d92b5417f1045..41da585ce8ecb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitPeering": + ) -> "_models.ExpressRouteCircuitPeering": """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> "models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, circuit_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCircuitPeering", + peering_parameters: "_models.ExpressRouteCircuitPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, circuit_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitPeeringListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuits_operations.py index 76819d64a0e5b..8ef649438e8cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCircuitsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, circuit_name: str, - parameters: "models.ExpressRouteCircuit", + parameters: "_models.ExpressRouteCircuit", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, circuit_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> "_models.ExpressRouteCircuit": """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,8 +410,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +463,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -474,7 +486,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -500,7 +512,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -521,8 +541,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -574,7 +594,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -597,7 +617,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -623,7 +643,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -644,8 +672,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -697,7 +725,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -720,7 +748,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +774,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -765,7 +801,7 @@ async def get_stats( resource_group_name: str, circuit_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -777,7 +813,7 @@ async def get_stats( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +860,7 @@ async def get_peering_stats( circuit_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCircuitStats": + ) -> "_models.ExpressRouteCircuitStats": """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -838,7 +874,7 @@ async def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +920,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -894,7 +930,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -953,7 +989,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCircuitListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -961,7 +997,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_connections_operations.py index 1b9a46f151e5d..160a4d90a59d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> "models.ExpressRouteConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, express_route_gateway_name: str, connection_name: str, - put_express_route_connection_parameters: "models.ExpressRouteConnection", + put_express_route_connection_parameters: "_models.ExpressRouteConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> "models.ExpressRouteConnection": + ) -> "_models.ExpressRouteConnection": """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ async def list( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteConnectionList": + ) -> "_models.ExpressRouteConnectionList": """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py index 9adeb78b33376..316adfd7fe457 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionPeeringList"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -231,7 +238,7 @@ async def get( cross_connection_name: str, peering_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> "_models.ExpressRouteCrossConnectionPeering": """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -245,7 +252,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,10 +299,10 @@ async def _create_or_update_initial( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,9 +358,9 @@ async def begin_create_or_update( resource_group_name: str, cross_connection_name: str, peering_name: str, - peering_parameters: "models.ExpressRouteCrossConnectionPeering", + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -376,7 +383,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connections_operations.py index a61329239a1fa..028bc341a04b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRouteCrossConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteCrossConnectionListResult"]: + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, cross_connection_name: str, **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -197,7 +197,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +295,9 @@ async def begin_create_or_update( self, resource_group_name: str, cross_connection_name: str, - parameters: "models.ExpressRouteCrossConnection", + parameters: "_models.ExpressRouteCrossConnection", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -317,7 +317,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -360,9 +366,9 @@ async def update_tags( self, resource_group_name: str, cross_connection_name: str, - cross_connection_parameters: "models.TagsObject", + cross_connection_parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> "_models.ExpressRouteCrossConnection": """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -377,7 +383,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -430,8 +436,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -483,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -506,7 +512,7 @@ async def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -532,7 +538,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +567,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,7 +620,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -629,7 +643,7 @@ async def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -655,7 +669,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -676,8 +698,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +751,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -752,7 +774,7 @@ async def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -778,7 +800,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_gateways_operations.py index 0c6ef9658a1b0..fe2f3dea6ec12 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class ExpressRouteGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_by_subscription( self, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.ExpressRouteGatewayList": + ) -> "_models.ExpressRouteGatewayList": """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -106,7 +106,7 @@ async def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -150,10 +150,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> "models.ExpressRouteGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,9 +207,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_gateway_name: str, - put_express_route_gateway_parameters: "models.ExpressRouteGateway", + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", **kwargs - ) -> AsyncLROPoller["models.ExpressRouteGateway"]: + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -230,7 +230,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -255,7 +255,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -274,7 +280,7 @@ async def get( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> "models.ExpressRouteGateway": + ) -> "_models.ExpressRouteGateway": """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +422,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_links_operations.py index f5f203add061f..b0896188a9d61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( express_route_port_name: str, link_name: str, **kwargs - ) -> "models.ExpressRouteLink": + ) -> "_models.ExpressRouteLink": """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRouteLinkListResult"]: + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_locations_operations.py index 65098cfaf76f6..65688e67e3142 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRoutePortsLocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortsLocationListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get( self, location_name: str, **kwargs - ) -> "models.ExpressRoutePortsLocation": + ) -> "_models.ExpressRoutePortsLocation": """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -124,7 +124,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_operations.py index b03252d5a72ab..68390a81335b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ExpressRoutePortsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.ExpressRoutePort", + parameters: "_models.ExpressRoutePort", **kwargs - ) -> AsyncLROPoller["models.ExpressRoutePort"]: + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, express_route_port_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> "_models.ExpressRoutePort": """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRoutePortListResult"]: + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,9 +543,9 @@ async def generate_loa( self, resource_group_name: str, express_route_port_name: str, - request: "models.GenerateExpressRoutePortsLOARequest", + request: "_models.GenerateExpressRoutePortsLOARequest", **kwargs - ) -> "models.GenerateExpressRoutePortsLOAResult": + ) -> "_models.GenerateExpressRoutePortsLOAResult": """Generate a letter of authorization for the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -547,7 +559,7 @@ async def generate_loa( :rtype: ~azure.mgmt.network.v2020_06_01.models.GenerateExpressRoutePortsLOAResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateExpressRoutePortsLOAResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateExpressRoutePortsLOAResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_service_providers_operations.py index b54ab644c9aa1..aabfd4bda84aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ExpressRouteServiceProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ExpressRouteServiceProviderListResult"]: + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policies_operations.py index 16673ba31fb57..3921e330c7e52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( firewall_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.FirewallPolicy": + ) -> "_models.FirewallPolicy": """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, firewall_policy_name: str, - parameters: "models.FirewallPolicy", + parameters: "_models.FirewallPolicy", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicy"]: + ) -> AsyncLROPoller["_models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,7 +346,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -344,7 +356,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.FirewallPolicyListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -411,7 +423,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py index bd9c59395739e..7b29741e57cca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FirewallPolicyRuleCollectionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( firewall_policy_name: str, rule_collection_group_name: str, **kwargs - ) -> "models.FirewallPolicyRuleCollectionGroup": + ) -> "_models.FirewallPolicyRuleCollectionGroup": """Gets the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FirewallPolicyRuleCollectionGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, - parameters: "models.FirewallPolicyRuleCollectionGroup", + parameters: "_models.FirewallPolicyRuleCollectionGroup", **kwargs - ) -> "models.FirewallPolicyRuleCollectionGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + ) -> "_models.FirewallPolicyRuleCollectionGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, firewall_policy_name: str, rule_collection_group_name: str, - parameters: "models.FirewallPolicyRuleCollectionGroup", + parameters: "_models.FirewallPolicyRuleCollectionGroup", **kwargs - ) -> AsyncLROPoller["models.FirewallPolicyRuleCollectionGroup"]: + ) -> AsyncLROPoller["_models.FirewallPolicyRuleCollectionGroup"]: """Creates or updates the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> AsyncIterable["models.FirewallPolicyRuleCollectionGroupListResult"]: + ) -> AsyncIterable["_models.FirewallPolicyRuleCollectionGroupListResult"]: """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.FirewallPolicyRuleCollectionGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_flow_logs_operations.py index d81fb555cd1d8..0737f93a1f6a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class FlowLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> "models.FlowLog": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -108,9 +108,9 @@ async def begin_create_or_update( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.FlowLog", + parameters: "_models.FlowLog", **kwargs - ) -> AsyncLROPoller["models.FlowLog"]: + ) -> AsyncLROPoller["_models.FlowLog"]: """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,9 +184,9 @@ async def update_tags( resource_group_name: str, network_watcher_name: str, flow_log_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Update tags of the specified flow log. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,7 +239,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -249,7 +256,7 @@ async def get( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> "models.FlowLog": + ) -> "_models.FlowLog": """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -263,7 +270,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +302,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -345,7 +352,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -401,7 +408,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -420,7 +434,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.FlowLogListResult"]: + ) -> AsyncIterable["_models.FlowLogListResult"]: """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -432,7 +446,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +493,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_route_tables_operations.py index 40a094d3477f1..b3599c66b90d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class HubRouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - route_table_parameters: "models.HubRouteTable", + route_table_parameters: "_models.HubRouteTable", **kwargs - ) -> "models.HubRouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + ) -> "_models.HubRouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - route_table_parameters: "models.HubRouteTable", + route_table_parameters: "_models.HubRouteTable", **kwargs - ) -> AsyncLROPoller["models.HubRouteTable"]: + ) -> AsyncLROPoller["_models.HubRouteTable"]: """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -177,7 +184,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.HubRouteTable": + ) -> "_models.HubRouteTable": """Retrieves the details of a RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +198,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.HubRouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubRouteTablesResult"]: + ) -> AsyncIterable["_models.ListHubRouteTablesResult"]: """Retrieves the details of all RouteTables. :param resource_group_name: The resource group name of the VirtualHub. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListHubRouteTablesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_virtual_network_connections_operations.py index 5cfd24a0a915c..c9fb2d4f1d211 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class HubVirtualNetworkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, connection_name: str, - hub_virtual_network_connection_parameters: "models.HubVirtualNetworkConnection", + hub_virtual_network_connection_parameters: "_models.HubVirtualNetworkConnection", **kwargs - ) -> "models.HubVirtualNetworkConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + ) -> "_models.HubVirtualNetworkConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, connection_name: str, - hub_virtual_network_connection_parameters: "models.HubVirtualNetworkConnection", + hub_virtual_network_connection_parameters: "_models.HubVirtualNetworkConnection", **kwargs - ) -> AsyncLROPoller["models.HubVirtualNetworkConnection"]: + ) -> AsyncLROPoller["_models.HubVirtualNetworkConnection"]: """Creates a hub virtual network connection if it doesn't exist else updates the existing one. :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -266,7 +273,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -286,7 +300,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.HubVirtualNetworkConnection": + ) -> "_models.HubVirtualNetworkConnection": """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -300,7 +314,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListHubVirtualNetworkConnectionsResult"]: + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_nat_rules_operations.py index 26a55262aad16..ca83a44c66857 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class InboundNatRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.InboundNatRuleListResult"]: + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -232,7 +239,7 @@ async def get( inbound_nat_rule_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.InboundNatRule": + ) -> "_models.InboundNatRule": """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -248,7 +255,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,10 +304,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,9 +363,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "models.InboundNatRule", + inbound_nat_rule_parameters: "_models.InboundNatRule", **kwargs - ) -> AsyncLROPoller["models.InboundNatRule"]: + ) -> AsyncLROPoller["_models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -381,7 +388,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -407,7 +414,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_security_rule_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_security_rule_operations.py index aaf655100fb49..78de34a2ec45f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_security_rule_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_inbound_security_rule_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class InboundSecurityRuleOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, network_virtual_appliance_name: str, rule_collection_name: str, - parameters: "models.InboundSecurityRule", + parameters: "_models.InboundSecurityRule", **kwargs - ) -> "models.InboundSecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundSecurityRule"] + ) -> "_models.InboundSecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, network_virtual_appliance_name: str, rule_collection_name: str, - parameters: "models.InboundSecurityRule", + parameters: "_models.InboundSecurityRule", **kwargs - ) -> AsyncLROPoller["models.InboundSecurityRule"]: + ) -> AsyncLROPoller["_models.InboundSecurityRule"]: """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundSecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'ruleCollectionName': self._serialize.url("rule_collection_name", rule_collection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_allocations_operations.py index de48317a8c3d2..988f2056da76d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpAllocationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( ip_allocation_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> "models.IpAllocation": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + ) -> "_models.IpAllocation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.IpAllocation", + parameters: "_models.IpAllocation", **kwargs - ) -> AsyncLROPoller["models.IpAllocation"]: + ) -> AsyncLROPoller["_models.IpAllocation"]: """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, ip_allocation_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpAllocation": + ) -> "_models.IpAllocation": """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpAllocationListResult"]: + ) -> AsyncIterable["_models.IpAllocationListResult"]: """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_groups_operations.py index 57b302fd707a2..aeb0f9c35c53a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class IpGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( ip_groups_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -112,10 +112,10 @@ async def _create_or_update_initial( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> "models.IpGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,9 +170,9 @@ async def begin_create_or_update( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.IpGroup", + parameters: "_models.IpGroup", **kwargs - ) -> AsyncLROPoller["models.IpGroup"]: + ) -> AsyncLROPoller["_models.IpGroup"]: """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +192,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -235,9 +241,9 @@ async def update_groups( self, resource_group_name: str, ip_groups_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.IpGroup": + ) -> "_models.IpGroup": """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -251,7 +257,7 @@ async def update_groups( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +293,7 @@ async def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -335,7 +341,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -405,7 +417,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -415,7 +427,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,7 +487,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.IpGroupListResult"]: + ) -> AsyncIterable["_models.IpGroupListResult"]: """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -483,7 +495,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +540,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py index 35149a2acf799..079f35aa689c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancerBackendAddressPoolsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerBackendAddressPoolListResult"]: + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ async def get( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> "models.BackendAddressPool": + ) -> "_models.BackendAddressPool": """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,10 +184,10 @@ async def _create_or_update_initial( resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, - parameters: "models.BackendAddressPool", + parameters: "_models.BackendAddressPool", **kwargs - ) -> "models.BackendAddressPool": - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + ) -> "_models.BackendAddressPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,9 +243,9 @@ async def begin_create_or_update( resource_group_name: str, load_balancer_name: str, backend_address_pool_name: str, - parameters: "models.BackendAddressPool", + parameters: "_models.BackendAddressPool", **kwargs - ) -> AsyncLROPoller["models.BackendAddressPool"]: + ) -> AsyncLROPoller["_models.BackendAddressPool"]: """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -268,7 +268,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -294,7 +294,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -402,7 +409,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py index 3c6ff4b79c6d1..532d00479e26d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerFrontendIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerFrontendIPConfigurationListResult"]: + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, frontend_ip_configuration_name: str, **kwargs - ) -> "models.FrontendIPConfiguration": + ) -> "_models.FrontendIPConfiguration": """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py index 78e41815eb5e6..795ddc6d73404 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerLoadBalancingRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerLoadBalancingRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, load_balancing_rule_name: str, **kwargs - ) -> "models.LoadBalancingRule": + ) -> "_models.LoadBalancingRule": """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_network_interfaces_operations.py index 1f26c16196658..d4b5cacebef69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerNetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_outbound_rules_operations.py index c57e724e61651..b78487bb3337e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerOutboundRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerOutboundRuleListResult"]: + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, outbound_rule_name: str, **kwargs - ) -> "models.OutboundRule": + ) -> "_models.OutboundRule": """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_probes_operations.py index b9a448d11b04b..2615372e3f5dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LoadBalancerProbesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerProbeListResult"]: + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( load_balancer_name: str, probe_name: str, **kwargs - ) -> "models.Probe": + ) -> "_models.Probe": """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancers_operations.py index 7ec2ef3f53415..2957d1523b550 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( load_balancer_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.LoadBalancer", + parameters: "_models.LoadBalancer", **kwargs - ) -> AsyncLROPoller["models.LoadBalancer"]: + ) -> AsyncLROPoller["_models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, load_balancer_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> "_models.LoadBalancer": """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LoadBalancerListResult"]: + ) -> AsyncIterable["_models.LoadBalancerListResult"]: """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_local_network_gateways_operations.py index 8687cdbdd5e2d..718592f172450 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LocalNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> "models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.LocalNetworkGateway", + parameters: "_models.LocalNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.LocalNetworkGateway"]: + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, local_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> "_models.LocalNetworkGateway": """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +407,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.LocalNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -405,7 +417,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_nat_gateways_operations.py index 5bd6ee6caae27..511ff43092dd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NatGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( nat_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> "models.NatGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + ) -> Optional["_models.NatGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NatGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,15 +259,13 @@ async def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + deserialized = None if response.status_code == 200: deserialized = self._deserialize('NatGateway', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('NatGateway', pipeline_response) - if response.status_code == 202: - deserialized = self._deserialize('NatGateway', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) @@ -272,9 +276,9 @@ async def begin_create_or_update( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.NatGateway", + parameters: "_models.NatGateway", **kwargs - ) -> AsyncLROPoller["models.NatGateway"]: + ) -> AsyncLROPoller["_models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -294,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,9 +347,9 @@ async def update_tags( self, resource_group_name: str, nat_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NatGateway": + ) -> "_models.NatGateway": """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -353,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NatGatewayListResult"]: + ) -> AsyncIterable["_models.NatGatewayListResult"]: """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_ip_configurations_operations.py index 04d1fbb00899e..c1616fed948bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceIPConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_load_balancers_operations.py index e9c6dec98135c..997c8003b91a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class NetworkInterfaceLoadBalancersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceLoadBalancerListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_tap_configurations_operations.py index f5267921ee8c6..49657c2d16faf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfaceTapConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": + ) -> "_models.NetworkInterfaceTapConfiguration": """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "models.NetworkInterfaceTapConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_interface_name: str, tap_configuration_name: str, - tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", **kwargs - ) -> AsyncLROPoller["models.NetworkInterfaceTapConfiguration"]: + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceTapConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interfaces_operations.py index 3e9816fe563d9..1064ba4a39597 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkInterfacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_interface_name: str, - parameters: "models.NetworkInterface", + parameters: "_models.NetworkInterface", **kwargs - ) -> AsyncLROPoller["models.NetworkInterface"]: + ) -> AsyncLROPoller["_models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, network_interface_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,8 +549,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +598,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -604,7 +616,7 @@ async def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -628,7 +640,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,8 +665,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +714,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> AsyncLROPoller["models.EffectiveNetworkSecurityGroupListResult"]: + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,7 +732,7 @@ async def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -738,7 +756,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -758,7 +782,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtual_machine_scale_set_name: str, virtualmachine_index: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -773,7 +797,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -836,7 +860,7 @@ def list_virtual_machine_scale_set_network_interfaces( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -848,7 +872,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -913,7 +937,7 @@ async def get_virtual_machine_scale_set_network_interface( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterface": + ) -> "_models.NetworkInterface": """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -931,7 +955,7 @@ async def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,7 +1008,7 @@ def list_virtual_machine_scale_set_ip_configurations( network_interface_name: str, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.NetworkInterfaceIPConfigurationListResult"]: + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1002,7 +1026,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1072,7 +1096,7 @@ async def get_virtual_machine_scale_set_ip_configuration( ip_configuration_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkInterfaceIPConfiguration": + ) -> "_models.NetworkInterfaceIPConfiguration": """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1092,7 +1116,7 @@ async def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_management_client_operations.py index b049c2b34f017..7b7916a97a2ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -27,10 +27,10 @@ async def _put_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> Optional["models.BastionShareableLinkListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -82,9 +82,9 @@ async def begin_put_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionShareableLinkListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -103,7 +103,7 @@ async def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -164,7 +164,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,7 +191,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -209,7 +215,7 @@ async def _delete_bastion_shareable_link_initial( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -259,7 +265,7 @@ async def begin_delete_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs ) -> AsyncLROPoller[None]: """Deletes the Bastion Shareable Links for all the VMs specified in the request. @@ -303,7 +309,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -321,9 +333,9 @@ def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + bsl_request: "_models.BastionShareableLinkListRequest", **kwargs - ) -> AsyncIterable["models.BastionShareableLinkListResult"]: + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -337,7 +349,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,8 +419,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> Optional["models.BastionActiveSessionListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +468,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.BastionActiveSessionListResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -473,7 +485,7 @@ async def begin_get_active_sessions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +538,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -552,7 +564,13 @@ async def internal_get_next(next_link=None): return AsyncItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -570,9 +588,9 @@ def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", + session_ids: "_models.SessionIds", **kwargs - ) -> AsyncIterable["models.BastionSessionDeleteResult"]: + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -586,7 +604,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +674,7 @@ async def check_dns_name_availability( location: str, domain_name_label: str, **kwargs - ) -> "models.DnsNameAvailabilityResult": + ) -> "_models.DnsNameAvailabilityResult": """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -669,7 +687,7 @@ async def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -715,7 +733,7 @@ async def supported_security_providers( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWanSecurityProviders": + ) -> "_models.VirtualWanSecurityProviders": """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -728,7 +746,7 @@ async def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -773,10 +791,10 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -828,9 +846,9 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + vpn_client_params: "_models.VirtualWanVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -853,7 +871,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -878,7 +896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_profiles_operations.py index 186d94c7378fa..c15318daaff30 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_profile_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def create_or_update( self, resource_group_name: str, network_profile_name: str, - parameters: "models.NetworkProfile", + parameters: "_models.NetworkProfile", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -228,7 +234,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +288,9 @@ async def update_tags( self, resource_group_name: str, network_profile_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkProfile": + ) -> "_models.NetworkProfile": """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -298,7 +304,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +353,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +361,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +420,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkProfileListResult"]: + ) -> AsyncIterable["_models.NetworkProfileListResult"]: """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -424,7 +430,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_security_groups_operations.py index e697d7ee3ee29..869b057bf390b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkSecurityGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_security_group_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> "models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.NetworkSecurityGroup", + parameters: "_models.NetworkSecurityGroup", **kwargs - ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, network_security_group_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> "_models.NetworkSecurityGroup": """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkSecurityGroupListResult"]: + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_virtual_appliances_operations.py index ec74604670518..f8e6725951ad6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkVirtualAppliancesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( network_virtual_appliance_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +218,9 @@ async def update_tags( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> "_models.NetworkVirtualAppliance": """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -228,7 +234,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,10 +284,10 @@ async def _create_or_update_initial( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + ) -> "_models.NetworkVirtualAppliance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,9 +341,9 @@ async def begin_create_or_update( self, resource_group_name: str, network_virtual_appliance_name: str, - parameters: "models.NetworkVirtualAppliance", + parameters: "_models.NetworkVirtualAppliance", **kwargs - ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: + ) -> AsyncLROPoller["_models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -382,7 +388,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -400,7 +412,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_watchers_operations.py index 4e7e1665b4cf7..c20a9a61505a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NetworkWatchersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkWatcher", + parameters: "_models.NetworkWatcher", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -119,7 +119,7 @@ async def get( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -210,7 +210,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -262,7 +262,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -280,9 +286,9 @@ async def update_tags( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.NetworkWatcher": + ) -> "_models.NetworkWatcher": """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -332,7 +338,7 @@ async def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -347,7 +353,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +363,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +409,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -417,7 +423,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.NetworkWatcherListResult"]: + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -425,7 +431,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +476,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -485,9 +491,9 @@ async def get_topology( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TopologyParameters", + parameters: "_models.TopologyParameters", **kwargs - ) -> "models.Topology": + ) -> "_models.Topology": """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -501,7 +507,7 @@ async def get_topology( :rtype: ~azure.mgmt.network.v2020_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +543,7 @@ async def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -552,10 +558,10 @@ async def _verify_ip_flow_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> "models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -591,7 +597,7 @@ async def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -610,9 +616,9 @@ async def begin_verify_ip_flow( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.VerificationIPFlowParameters", + parameters: "_models.VerificationIPFlowParameters", **kwargs - ) -> AsyncLROPoller["models.VerificationIPFlowResult"]: + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -632,7 +638,7 @@ async def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -657,7 +663,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -675,10 +687,10 @@ async def _get_next_hop_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +726,7 @@ async def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -733,9 +745,9 @@ async def begin_get_next_hop( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NextHopParameters", + parameters: "_models.NextHopParameters", **kwargs - ) -> AsyncLROPoller["models.NextHopResult"]: + ) -> AsyncLROPoller["_models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -755,7 +767,7 @@ async def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -780,7 +792,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -798,10 +816,10 @@ async def _get_vm_security_rules_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> "models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -837,7 +855,7 @@ async def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -856,9 +874,9 @@ async def begin_get_vm_security_rules( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.SecurityGroupViewParameters", + parameters: "_models.SecurityGroupViewParameters", **kwargs - ) -> AsyncLROPoller["models.SecurityGroupViewResult"]: + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -878,7 +896,7 @@ async def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -903,7 +921,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -921,10 +945,10 @@ async def _get_troubleshooting_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -960,7 +984,7 @@ async def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -979,9 +1003,9 @@ async def begin_get_troubleshooting( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.TroubleshootingParameters", + parameters: "_models.TroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1001,7 +1025,7 @@ async def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1026,7 +1050,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1044,10 +1074,10 @@ async def _get_troubleshooting_result_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1083,7 +1113,7 @@ async def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1102,9 +1132,9 @@ async def begin_get_troubleshooting_result( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.QueryTroubleshootingParameters", + parameters: "_models.QueryTroubleshootingParameters", **kwargs - ) -> AsyncLROPoller["models.TroubleshootingResult"]: + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1124,7 +1154,7 @@ async def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1149,7 +1179,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1167,10 +1203,10 @@ async def _set_flow_log_configuration_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1206,7 +1242,7 @@ async def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1225,9 +1261,9 @@ async def begin_set_flow_log_configuration( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogInformation", + parameters: "_models.FlowLogInformation", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1247,7 +1283,7 @@ async def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1272,7 +1308,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1290,10 +1332,10 @@ async def _get_flow_log_status_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> "models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1329,7 +1371,7 @@ async def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1348,9 +1390,9 @@ async def begin_get_flow_log_status( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.FlowLogStatusParameters", + parameters: "_models.FlowLogStatusParameters", **kwargs - ) -> AsyncLROPoller["models.FlowLogInformation"]: + ) -> AsyncLROPoller["_models.FlowLogInformation"]: """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1371,7 +1413,7 @@ async def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1396,7 +1438,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1414,10 +1462,10 @@ async def _check_connectivity_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> "models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1453,7 +1501,7 @@ async def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1472,9 +1520,9 @@ async def begin_check_connectivity( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.ConnectivityParameters", + parameters: "_models.ConnectivityParameters", **kwargs - ) -> AsyncLROPoller["models.ConnectivityInformation"]: + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1495,7 +1543,7 @@ async def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1520,7 +1568,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1538,10 +1592,10 @@ async def _get_azure_reachability_report_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1577,7 +1631,7 @@ async def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1596,9 +1650,9 @@ async def begin_get_azure_reachability_report( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AzureReachabilityReportParameters", + parameters: "_models.AzureReachabilityReportParameters", **kwargs - ) -> AsyncLROPoller["models.AzureReachabilityReport"]: + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1620,7 +1674,7 @@ async def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1699,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1663,10 +1723,10 @@ async def _list_available_providers_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> "models.AvailableProvidersList": - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1702,7 +1762,7 @@ async def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1721,9 +1781,9 @@ async def begin_list_available_providers( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.AvailableProvidersListParameters", + parameters: "_models.AvailableProvidersListParameters", **kwargs - ) -> AsyncLROPoller["models.AvailableProvidersList"]: + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1744,7 +1804,7 @@ async def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1769,7 +1829,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1787,10 +1853,10 @@ async def _get_network_configuration_diagnostic_initial( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1826,7 +1892,7 @@ async def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1845,9 +1911,9 @@ async def begin_get_network_configuration_diagnostic( self, resource_group_name: str, network_watcher_name: str, - parameters: "models.NetworkConfigurationDiagnosticParameters", + parameters: "_models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1871,7 +1937,7 @@ async def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_operations.py index 829e36b17ff11..22934ca58803b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_p2_svpn_gateways_operations.py index dccacac8f5a2d..eb8c68292e387 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class P2SVpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> "_models.P2SVpnGateway": """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,10 +234,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,9 +289,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - p2_s_vpn_gateway_parameters: "models.TagsObject", + p2_s_vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -306,7 +312,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +337,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -433,7 +445,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,7 +469,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -461,7 +479,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListP2SVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +546,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,8 +606,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -637,7 +655,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Resets the primary of the p2s vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -655,7 +673,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -679,7 +697,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -697,10 +721,10 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> Optional["models.VpnProfileResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -752,9 +776,9 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, gateway_name: str, - parameters: "models.P2SVpnProfileParameters", + parameters: "_models.P2SVpnProfileParameters", **kwargs - ) -> AsyncLROPoller["models.VpnProfileResponse"]: + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -775,7 +799,7 @@ async def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -819,8 +849,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.P2SVpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,7 +898,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.P2SVpnGateway"]: + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -887,7 +917,7 @@ async def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -911,7 +941,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -929,10 +965,10 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> Optional["models.P2SVpnConnectionHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -984,9 +1020,9 @@ async def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name: str, gateway_name: str, - request: "models.P2SVpnConnectionHealthRequest", + request: "_models.P2SVpnConnectionHealthRequest", **kwargs - ) -> AsyncLROPoller["models.P2SVpnConnectionHealth"]: + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -1007,7 +1043,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1032,7 +1068,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1050,7 +1092,7 @@ async def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1100,7 +1142,7 @@ async def begin_disconnect_p2_s_vpn_connections( self, resource_group_name: str, p2_s_vpn_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource @@ -1145,7 +1187,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_packet_captures_operations.py index b362bdb204804..bb89be36371b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PacketCapturesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_initial( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> "models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -104,9 +104,9 @@ async def begin_create( resource_group_name: str, network_watcher_name: str, packet_capture_name: str, - parameters: "models.PacketCapture", + parameters: "_models.PacketCapture", **kwargs - ) -> AsyncLROPoller["models.PacketCaptureResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -174,7 +181,7 @@ async def get( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureResult": + ) -> "_models.PacketCaptureResult": """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -188,7 +195,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -270,7 +277,7 @@ async def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +393,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -435,7 +449,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -455,8 +476,8 @@ async def _get_status_initial( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ async def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -509,7 +530,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -529,7 +550,7 @@ async def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -554,7 +575,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -573,7 +601,7 @@ def list( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> AsyncIterable["models.PacketCaptureListResult"]: + ) -> AsyncIterable["_models.PacketCaptureListResult"]: """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -585,7 +613,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +660,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py index 2612dcca1e84c..f13c252c4e795 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PeerExpressRouteCircuitConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( peering_name: str, connection_name: str, **kwargs - ) -> "models.PeerExpressRouteCircuitConnection": + ) -> "_models.PeerExpressRouteCircuitConnection": """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -65,7 +65,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( circuit_name: str, peering_name: str, **kwargs - ) -> AsyncIterable["models.PeerExpressRouteCircuitConnectionListResult"]: + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -129,7 +129,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_dns_zone_groups_operations.py index b01890d426fa1..bee1c0a14930e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateDnsZoneGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs - ) -> "models.PrivateDnsZoneGroup": + ) -> "_models.PrivateDnsZoneGroup": """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> "models.PrivateDnsZoneGroup": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + ) -> "_models.PrivateDnsZoneGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, private_endpoint_name: str, private_dns_zone_group_name: str, - parameters: "models.PrivateDnsZoneGroup", + parameters: "_models.PrivateDnsZoneGroup", **kwargs - ) -> AsyncLROPoller["models.PrivateDnsZoneGroup"]: + ) -> AsyncLROPoller["_models.PrivateDnsZoneGroup"]: """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( private_endpoint_name: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateDnsZoneGroupListResult"]: + ) -> AsyncIterable["_models.PrivateDnsZoneGroupListResult"]: """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +420,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_endpoints_operations.py index 1d39d84ba397b..aa6a319cb17ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( private_endpoint_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpoint": + ) -> "_models.PrivateEndpoint": """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> "models.PrivateEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, private_endpoint_name: str, - parameters: "models.PrivateEndpoint", + parameters: "_models.PrivateEndpoint", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpoint"]: + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateEndpointListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_link_services_operations.py index 5e387626e2046..992eb4bdaeb61 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkServicesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( service_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateLinkService": + ) -> "_models.PrivateLinkService": """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> "models.PrivateLinkService": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_name: str, - parameters: "models.PrivateLinkService", + parameters: "_models.PrivateLinkService", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkService"]: + ) -> AsyncLROPoller["_models.PrivateLinkService"]: """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.PrivateLinkServiceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -478,7 +490,7 @@ async def get_private_endpoint_connection( pe_connection_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Get the specific private end point connection by specific private link service in the resource group. @@ -495,7 +507,7 @@ async def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +541,7 @@ async def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -545,9 +557,9 @@ async def update_private_endpoint_connection( resource_group_name: str, service_name: str, pe_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -563,7 +575,7 @@ async def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ async def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -650,7 +662,7 @@ async def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -706,7 +718,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -725,7 +744,7 @@ def list_private_endpoint_connections( resource_group_name: str, service_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -737,7 +756,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +803,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -798,10 +817,10 @@ async def get_next(next_link=None): async def _check_private_link_service_visibility_initial( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -851,9 +870,9 @@ async def _check_private_link_service_visibility_initial( async def begin_check_private_link_service_visibility( self, location: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -871,7 +890,7 @@ async def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -895,7 +914,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -913,10 +937,10 @@ async def _check_private_link_service_visibility_by_resource_group_initial( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> Optional["models.PrivateLinkServiceVisibility"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,9 +992,9 @@ async def begin_check_private_link_service_visibility_by_resource_group( self, location: str, resource_group_name: str, - parameters: "models.CheckPrivateLinkServiceVisibilityRequest", + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: """Checks whether the subscription is visible to private link service in the specified resource group. @@ -991,7 +1015,7 @@ async def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1016,7 +1040,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1034,7 +1064,7 @@ def list_auto_approved_private_link_services( self, location: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1045,7 +1075,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1106,7 +1136,7 @@ def list_auto_approved_private_link_services_by_resource_group( location: str, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoApprovedPrivateLinkServicesResult"]: + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1119,7 +1149,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_addresses_operations.py index 7d69979087a58..6002a92014ca8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPAddressesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> "models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.PublicIPAddress", + parameters: "_models.PublicIPAddress", **kwargs - ) -> AsyncLROPoller["models.PublicIPAddress"]: + ) -> AsyncLROPoller["_models.PublicIPAddress"]: """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_address_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( resource_group_name: str, virtual_machine_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -549,7 +561,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -614,7 +626,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( network_interface_name: str, ip_configuration_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPAddressListResult"]: + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -633,7 +645,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +715,7 @@ async def get_virtual_machine_scale_set_public_ip_address( public_ip_address_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPAddress": + ) -> "_models.PublicIPAddress": """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -725,7 +737,7 @@ async def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_prefixes_operations.py index cb8f4fbf962c5..5cc832bc247ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PublicIPPrefixesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( public_ip_prefix_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> "models.PublicIPPrefix": - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.PublicIPPrefix", + parameters: "_models.PublicIPPrefix", **kwargs - ) -> AsyncLROPoller["models.PublicIPPrefix"]: + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, public_ip_prefix_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> "_models.PublicIPPrefix": """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.PublicIPPrefixListResult"]: + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_resource_navigation_links_operations.py index 92ee52e8d41b0..88dbb45fb03e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ResourceNavigationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ResourceNavigationLinksListResult": + ) -> "_models.ResourceNavigationLinksListResult": """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filter_rules_operations.py index 1d2e94d87f6fe..9f71764d6a2ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFilterRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_filter_name: str, rule_name: str, **kwargs - ) -> "models.RouteFilterRule": + ) -> "_models.RouteFilterRule": """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_filter_name: str, rule_name: str, - route_filter_rule_parameters: "models.RouteFilterRule", + route_filter_rule_parameters: "_models.RouteFilterRule", **kwargs - ) -> AsyncLROPoller["models.RouteFilterRule"]: + ) -> AsyncLROPoller["_models.RouteFilterRule"]: """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list_by_route_filter( resource_group_name: str, route_filter_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterRuleListResult"]: + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list_by_route_filter( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filters_operations.py index ef6fcc854a780..ae700c7faf4ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteFiltersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_filter_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> "models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_filter_name: str, - route_filter_parameters: "models.RouteFilter", + route_filter_parameters: "_models.RouteFilter", **kwargs - ) -> AsyncLROPoller["models.RouteFilter"]: + ) -> AsyncLROPoller["_models.RouteFilter"]: """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, route_filter_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteFilter": + ) -> "_models.RouteFilter": """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +413,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,7 +482,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.RouteFilterListResult"]: + ) -> AsyncIterable["_models.RouteFilterListResult"]: """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,7 +490,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_tables_operations.py index ad3812fe08480..1056183e78847 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RouteTablesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( route_table_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> "models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, route_table_name: str, - parameters: "models.RouteTable", + parameters: "_models.RouteTable", **kwargs - ) -> AsyncLROPoller["models.RouteTable"]: + ) -> AsyncLROPoller["_models.RouteTable"]: """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, route_table_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> "_models.RouteTable": """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +481,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.RouteTableListResult"]: + ) -> AsyncIterable["_models.RouteTableListResult"]: """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -477,7 +489,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_routes_operations.py index a2ca1ba9ed393..7f16b5fa234dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class RoutesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( route_table_name: str, route_name: str, **kwargs - ) -> "models.Route": + ) -> "_models.Route": """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> "models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, route_table_name: str, route_name: str, - route_parameters: "models.Route", + route_parameters: "_models.Route", **kwargs - ) -> AsyncLROPoller["models.Route"]: + ) -> AsyncLROPoller["_models.Route"]: """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -301,7 +308,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -346,7 +360,7 @@ def list( resource_group_name: str, route_table_name: str, **kwargs - ) -> AsyncIterable["models.RouteListResult"]: + ) -> AsyncIterable["_models.RouteListResult"]: """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -358,7 +372,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_partner_providers_operations.py index cb41190d15600..3a5b1f7b33d26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityPartnerProvidersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, security_partner_provider_name: str, **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> "models.SecurityPartnerProvider": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + ) -> "_models.SecurityPartnerProvider": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.SecurityPartnerProvider", + parameters: "_models.SecurityPartnerProvider", **kwargs - ) -> AsyncLROPoller["models.SecurityPartnerProvider"]: + ) -> AsyncLROPoller["_models.SecurityPartnerProvider"]: """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -287,7 +293,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -312,7 +318,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -330,9 +342,9 @@ async def update_tags( self, resource_group_name: str, security_partner_provider_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> "_models.SecurityPartnerProvider": """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -396,7 +408,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +477,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SecurityPartnerProviderListResult"]: + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -473,7 +485,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_rules_operations.py index b913bce2dc52f..55f0e8c066130 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SecurityRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> "models.SecurityRule": + ) -> "_models.SecurityRule": """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> "models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_security_group_name: str, security_rule_name: str, - security_rule_parameters: "models.SecurityRule", + security_rule_parameters: "_models.SecurityRule", **kwargs - ) -> AsyncLROPoller["models.SecurityRule"]: + ) -> AsyncLROPoller["_models.SecurityRule"]: """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> AsyncIterable["models.SecurityRuleListResult"]: + ) -> AsyncIterable["_models.SecurityRuleListResult"]: """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_association_links_operations.py index a5b5e28503205..38f1194637e4f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceAssociationLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def list( virtual_network_name: str, subnet_name: str, **kwargs - ) -> "models.ServiceAssociationLinksListResult": + ) -> "_models.ServiceAssociationLinksListResult": """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policies_operations.py index 6edc586611a85..d17d3b480ea44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( service_endpoint_policy_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.ServiceEndpointPolicy", + parameters: "_models.ServiceEndpointPolicy", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -292,7 +298,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -317,7 +323,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -335,9 +347,9 @@ async def update_tags( self, resource_group_name: str, service_endpoint_policy_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> "_models.ServiceEndpointPolicy": """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -351,7 +363,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -400,7 +412,7 @@ async def update_tags( def list( self, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -408,7 +420,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py index 6a97a31d85d23..0c0b711a744d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ServiceEndpointPolicyDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> "_models.ServiceEndpointPolicyDefinition": """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -173,7 +180,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,9 +286,9 @@ async def begin_create_or_update( resource_group_name: str, service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, - service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", **kwargs - ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list_by_resource_group( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> AsyncIterable["models.ServiceEndpointPolicyDefinitionListResult"]: + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_tags_operations.py index 2f7c81627ee68..b7730f2be3d31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceTagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def list( self, location: str, **kwargs - ) -> "models.ServiceTagsListResult": + ) -> "_models.ServiceTagsListResult": """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -56,7 +56,7 @@ async def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_subnets_operations.py index 197b3d2df25d2..de8e69b90c393 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SubnetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( subnet_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Subnet": + ) -> "_models.Subnet": """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -174,7 +181,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,10 +230,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> "models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,9 +289,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, subnet_name: str, - subnet_parameters: "models.Subnet", + subnet_parameters: "_models.Subnet", **kwargs - ) -> AsyncLROPoller["models.Subnet"]: + ) -> AsyncLROPoller["_models.Subnet"]: """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -306,7 +313,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ async def _prepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -403,7 +417,7 @@ async def begin_prepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. @@ -451,7 +465,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -470,7 +491,7 @@ async def _unprepare_network_policies_initial( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -522,7 +543,7 @@ async def begin_unprepare_network_policies( resource_group_name: str, virtual_network_name: str, subnet_name: str, - unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", **kwargs ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. @@ -570,7 +591,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -589,7 +617,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.SubnetListResult"]: + ) -> AsyncIterable["_models.SubnetListResult"]: """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -601,7 +629,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_usages_operations.py index f1e564eb3ae9e..d1a48d860c0c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.UsagesListResult"]: + ) -> AsyncIterable["_models.UsagesListResult"]: """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_sites_operations.py index d80f7cb9fa5a3..8be27c9c15307 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualApplianceSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( network_virtual_appliance_name: str, site_name: str, **kwargs - ) -> "models.VirtualApplianceSite": + ) -> "_models.VirtualApplianceSite": """Gets the specified Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualApplianceSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, network_virtual_appliance_name: str, site_name: str, - parameters: "models.VirtualApplianceSite", + parameters: "_models.VirtualApplianceSite", **kwargs - ) -> "models.VirtualApplianceSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + ) -> "_models.VirtualApplianceSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, network_virtual_appliance_name: str, site_name: str, - parameters: "models.VirtualApplianceSite", + parameters: "_models.VirtualApplianceSite", **kwargs - ) -> AsyncLROPoller["models.VirtualApplianceSite"]: + ) -> AsyncLROPoller["_models.VirtualApplianceSite"]: """Creates or updates the specified Network Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, network_virtual_appliance_name: str, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceSiteListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceSiteListResult"]: """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceSiteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSiteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_skus_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_skus_operations.py index 77e6bfbe40f74..99e581c14ee69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_skus_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_appliance_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualApplianceSkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.NetworkVirtualApplianceSkuListResult"]: + ) -> AsyncIterable["_models.NetworkVirtualApplianceSkuListResult"]: """List all SKUs available for a virtual appliance. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def get( self, sku_name: str, **kwargs - ) -> "models.NetworkVirtualApplianceSku": + ) -> "_models.NetworkVirtualApplianceSku": """Retrieves a single available sku for network virtual appliance. :param sku_name: Name of the Sku. @@ -121,7 +121,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceSku :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py index 761b2811b4363..08438ddd27f51 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualHubBgpConnectionOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( virtual_hub_name: str, connection_name: str, **kwargs - ) -> "models.BgpConnection": + ) -> "_models.BgpConnection": """Retrieves the details of a Virtual Hub Bgp Connection. :param resource_group_name: The resource group name of the VirtualHub. @@ -62,7 +62,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.BgpConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, connection_name: str, - parameters: "models.BgpConnection", + parameters: "_models.BgpConnection", **kwargs - ) -> "models.BgpConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + ) -> "_models.BgpConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,9 +168,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, connection_name: str, - parameters: "models.BgpConnection", + parameters: "_models.BgpConnection", **kwargs - ) -> AsyncLROPoller["models.BgpConnection"]: + ) -> AsyncLROPoller["_models.BgpConnection"]: """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. @@ -193,7 +193,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -327,7 +334,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connections_operations.py index da1a04a857aa9..68859c81fbf14 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubBgpConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubBgpConnectionResults"]: + ) -> AsyncIterable["_models.ListVirtualHubBgpConnectionResults"]: """Retrieves the details of all VirtualHubBgpConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubBgpConnectionResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubBgpConnectionResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,8 +123,8 @@ async def _list_learned_routes_initial( hub_name: str, connection_name: str, **kwargs - ) -> Optional["models.PeerRouteList"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PeerRouteList"]] + ) -> Optional["_models.PeerRouteList"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ async def begin_list_learned_routes( hub_name: str, connection_name: str, **kwargs - ) -> AsyncLROPoller["models.PeerRouteList"]: + ) -> AsyncLROPoller["_models.PeerRouteList"]: """Retrieves a list of routes the virtual hub bgp connection has learned. :param resource_group_name: The name of the resource group. @@ -194,7 +194,7 @@ async def begin_list_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -239,8 +246,8 @@ async def _list_advertised_routes_initial( hub_name: str, connection_name: str, **kwargs - ) -> Optional["models.PeerRouteList"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PeerRouteList"]] + ) -> Optional["_models.PeerRouteList"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,7 +297,7 @@ async def begin_list_advertised_routes( hub_name: str, connection_name: str, **kwargs - ) -> AsyncLROPoller["models.PeerRouteList"]: + ) -> AsyncLROPoller["_models.PeerRouteList"]: """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ async def begin_list_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_ip_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_ip_configuration_operations.py index 3ff749c7143cc..b2e0f8ddb8672 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_ip_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_ip_configuration_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubIpConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, ip_config_name: str, **kwargs - ) -> "models.HubIpConfiguration": + ) -> "_models.HubIpConfiguration": """Retrieves the details of a Virtual Hub Ip configuration. :param resource_group_name: The resource group name of the VirtualHub. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.HubIpConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, ip_config_name: str, - parameters: "models.HubIpConfiguration", + parameters: "_models.HubIpConfiguration", **kwargs - ) -> "models.HubIpConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + ) -> "_models.HubIpConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, ip_config_name: str, - parameters: "models.HubIpConfiguration", + parameters: "_models.HubIpConfiguration", **kwargs - ) -> AsyncLROPoller["models.HubIpConfiguration"]: + ) -> AsyncLROPoller["_models.HubIpConfiguration"]: """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubIpConfigurationResults"]: + ) -> AsyncIterable["_models.ListVirtualHubIpConfigurationResults"]: """Retrieves the details of all VirtualHubIpConfigurations. :param resource_group_name: The resource group name of the VirtualHub. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubIpConfigurationResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubIpConfigurationResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py index e9ffbd97d5f58..1250292938366 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubRouteTableV2SOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> "_models.VirtualHubRouteTableV2": """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -111,10 +111,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -171,9 +171,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_hub_name: str, route_table_name: str, - virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", **kwargs - ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -197,7 +197,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -223,7 +223,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -276,7 +283,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -351,7 +365,7 @@ def list( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubRouteTableV2SResult"]: + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py index e2dfaf45bed82..1c305da171d94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> "models.VirtualHub": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.VirtualHub", + virtual_hub_parameters: "_models.VirtualHub", **kwargs - ) -> AsyncLROPoller["models.VirtualHub"]: + ) -> AsyncLROPoller["_models.VirtualHub"]: """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_hub_name: str, - virtual_hub_parameters: "models.TagsObject", + virtual_hub_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> "_models.VirtualHub": """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualHubsResult"]: + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +543,7 @@ async def _get_effective_virtual_hub_routes_initial( self, resource_group_name: str, virtual_hub_name: str, - effective_routes_parameters: Optional["models.EffectiveRoutesParameters"] = None, + effective_routes_parameters: Optional["_models.EffectiveRoutesParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -584,7 +596,7 @@ async def begin_get_effective_virtual_hub_routes( self, resource_group_name: str, virtual_hub_name: str, - effective_routes_parameters: Optional["models.EffectiveRoutesParameters"] = None, + effective_routes_parameters: Optional["_models.EffectiveRoutesParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Gets the effective routes configured for the Virtual Hub resource or the specified resource . @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateway_connections_operations.py index 3df08178a3f51..44e39048eaa70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewayConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VirtualNetworkGatewayConnection", + parameters: "_models.VirtualNetworkGatewayConnection", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -172,7 +178,7 @@ async def get( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> "_models.VirtualNetworkGatewayConnection": """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -185,7 +191,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -333,10 +345,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGatewayConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +400,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -411,7 +423,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -436,7 +448,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -454,10 +472,10 @@ async def _set_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> "models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -511,9 +529,9 @@ async def begin_set_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionSharedKey", + parameters: "_models.ConnectionSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -536,7 +554,7 @@ async def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +579,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +604,7 @@ async def get_shared_key( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> "models.ConnectionSharedKey": + ) -> "_models.ConnectionSharedKey": """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -594,7 +618,7 @@ async def get_shared_key( :rtype: ~azure.mgmt.network.v2020_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -639,7 +663,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayConnectionListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -710,10 +734,10 @@ async def _reset_shared_key_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> Optional["models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,9 +789,9 @@ async def begin_reset_shared_key( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.ConnectionResetSharedKey", + parameters: "_models.ConnectionResetSharedKey", **kwargs - ) -> AsyncLROPoller["models.ConnectionResetSharedKey"]: + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -791,7 +815,7 @@ async def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -816,7 +840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -834,7 +864,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -876,7 +906,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -893,7 +923,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway connection in the specified resource group. @@ -942,7 +972,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -960,7 +996,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -999,7 +1035,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1016,7 +1052,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway connection in the specified resource group. @@ -1065,7 +1101,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateways_operations.py index c56920ab80afd..ff95a08324fbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VirtualNetworkGateway", + parameters: "_models.VirtualNetworkGateway", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -170,7 +176,7 @@ async def get( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> "_models.VirtualNetworkGateway": """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -182,7 +188,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ async def _update_tags_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -384,9 +396,9 @@ async def begin_update_tags( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -406,7 +418,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -431,7 +443,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -449,7 +467,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -459,7 +477,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -520,7 +538,7 @@ def list_connections( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkGatewayListConnectionsResult"]: + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -532,7 +550,7 @@ def list_connections( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,8 +613,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> Optional["models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +665,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -668,7 +686,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,7 +711,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -796,7 +820,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -814,7 +844,7 @@ async def _generatevpnclientpackage_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -869,7 +899,7 @@ async def begin_generatevpnclientpackage( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified @@ -918,7 +948,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -936,7 +972,7 @@ async def _generate_vpn_profile_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -991,7 +1027,7 @@ async def begin_generate_vpn_profile( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnClientParameters", + parameters: "_models.VpnClientParameters", **kwargs ) -> AsyncLROPoller[str]: """Generates VPN profile for P2S client of the virtual network gateway in the specified resource @@ -1040,7 +1076,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1151,7 +1193,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1171,8 +1219,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> Optional["models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1271,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.BgpPeerStatusListResult"]: + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1243,7 +1291,7 @@ async def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1316,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1345,8 +1399,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1448,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1413,7 +1467,7 @@ async def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1437,7 +1491,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1457,8 +1517,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> Optional["models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1508,7 +1568,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> AsyncLROPoller["models.GatewayRouteListResult"]: + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1529,7 +1589,7 @@ async def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1554,7 +1614,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1572,10 +1638,10 @@ async def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> Optional["models.VpnClientIPsecParameters"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,9 +1693,9 @@ async def begin_set_vpnclient_ipsec_parameters( self, resource_group_name: str, virtual_network_gateway_name: str, - vpnclient_ipsec_params: "models.VpnClientIPsecParameters", + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1651,7 +1717,7 @@ async def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,7 +1742,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1695,8 +1767,8 @@ async def _get_vpnclient_ipsec_parameters_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1742,7 +1814,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientIPsecParameters"]: + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1762,7 +1834,7 @@ async def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1786,7 +1858,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1804,7 +1882,7 @@ async def vpn_device_configuration_script( self, resource_group_name: str, virtual_network_gateway_connection_name: str, - parameters: "models.VpnDeviceScriptParameters", + parameters: "_models.VpnDeviceScriptParameters", **kwargs ) -> str: """Gets a xml format representation for vpn device configuration script. @@ -1871,7 +1949,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -1913,7 +1991,7 @@ async def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1930,7 +2008,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. @@ -1978,7 +2056,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1996,7 +2080,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -2035,7 +2119,7 @@ async def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2052,7 +2136,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, virtual_network_gateway_name: str, - parameters: "models.VpnPacketCaptureStopParameters", + parameters: "_models.VpnPacketCaptureStopParameters", **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. @@ -2100,7 +2184,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2119,8 +2209,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2168,7 +2258,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnClientConnectionHealthDetailListResult"]: + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2187,7 +2277,7 @@ async def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2211,7 +2301,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2229,7 +2325,7 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2279,7 +2375,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name: str, virtual_network_gateway_name: str, - request: "models.P2SVpnConnectionRequest", + request: "_models.P2SVpnConnectionRequest", **kwargs ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. @@ -2323,7 +2419,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_peerings_operations.py index 4f39e050dfbf2..e6c321d446757 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -137,7 +137,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -157,7 +164,7 @@ async def get( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> "models.VirtualNetworkPeering": + ) -> "_models.VirtualNetworkPeering": """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -171,7 +178,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,10 +225,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> "models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,9 +284,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_network_name: str, virtual_network_peering_name: str, - virtual_network_peering_parameters: "models.VirtualNetworkPeering", + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkPeering"]: + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -302,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ def list( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -359,7 +373,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_taps_operations.py index a68292a104908..9e78db5fa7c56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworkTapsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -150,7 +156,7 @@ async def get( resource_group_name: str, tap_name: str, **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -162,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -207,10 +213,10 @@ async def _create_or_update_initial( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,9 +270,9 @@ async def begin_create_or_update( self, resource_group_name: str, tap_name: str, - parameters: "models.VirtualNetworkTap", + parameters: "_models.VirtualNetworkTap", **kwargs - ) -> AsyncLROPoller["models.VirtualNetworkTap"]: + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -286,7 +292,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -329,9 +341,9 @@ async def update_tags( self, resource_group_name: str, tap_name: str, - tap_parameters: "models.TagsObject", + tap_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> "_models.VirtualNetworkTap": """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -345,7 +357,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +406,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -402,7 +414,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +473,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkTapListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -471,7 +483,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_networks_operations.py index e42b637c8b871..818184ed7c656 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualNetworksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -131,7 +131,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -151,7 +157,7 @@ async def get( virtual_network_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -165,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,10 +218,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> "models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,9 +275,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.VirtualNetwork", + parameters: "_models.VirtualNetwork", **kwargs - ) -> AsyncLROPoller["models.VirtualNetwork"]: + ) -> AsyncLROPoller["_models.VirtualNetwork"]: """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -291,7 +297,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +322,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -334,9 +346,9 @@ async def update_tags( self, resource_group_name: str, virtual_network_name: str, - parameters: "models.TagsObject", + parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> "_models.VirtualNetwork": """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -350,7 +362,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -399,7 +411,7 @@ async def update_tags( def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,7 +419,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +478,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +550,7 @@ async def check_ip_address_availability( virtual_network_name: str, ip_address: str, **kwargs - ) -> "models.IPAddressAvailabilityResult": + ) -> "_models.IPAddressAvailabilityResult": """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -552,7 +564,7 @@ async def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,7 +611,7 @@ def list_usage( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkListUsageResult"]: + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -611,7 +623,7 @@ def list_usage( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_router_peerings_operations.py index 30fdbc4a12e01..7e429af5d9836 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRouterPeeringsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -158,7 +165,7 @@ async def get( virtual_router_name: str, peering_name: str, **kwargs - ) -> "models.VirtualRouterPeering": + ) -> "_models.VirtualRouterPeering": """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -172,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +211,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -220,10 +227,10 @@ async def _create_or_update_initial( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,9 +287,9 @@ async def begin_create_or_update( resource_group_name: str, virtual_router_name: str, peering_name: str, - parameters: "models.VirtualRouterPeering", + parameters: "_models.VirtualRouterPeering", **kwargs - ) -> AsyncLROPoller["models.VirtualRouterPeering"]: + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -305,7 +312,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -331,7 +338,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -350,7 +364,7 @@ def list( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterPeeringListResult"]: + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -362,7 +376,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_routers_operations.py index b38dfc1d6ea95..2e53cdfe7d134 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualRoutersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -152,7 +158,7 @@ async def get( virtual_router_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualRouter": + ) -> "_models.VirtualRouter": """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -166,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,7 +205,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -214,10 +220,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +259,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -272,9 +278,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_router_name: str, - parameters: "models.VirtualRouter", + parameters: "_models.VirtualRouter", **kwargs - ) -> AsyncLROPoller["models.VirtualRouter"]: + ) -> AsyncLROPoller["_models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -337,7 +349,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -347,7 +359,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -393,7 +405,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -407,7 +419,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.VirtualRouterListResult"]: + ) -> AsyncIterable["_models.VirtualRouterListResult"]: """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -415,7 +427,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -460,7 +472,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_wans_operations.py index f67feb3448325..4622c4380faf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualWansOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> "models.VirtualWAN": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.VirtualWAN", + wan_parameters: "_models.VirtualWAN", **kwargs - ) -> AsyncLROPoller["models.VirtualWAN"]: + ) -> AsyncLROPoller["_models.VirtualWAN"]: """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, virtual_wan_name: str, - wan_parameters: "models.TagsObject", + wan_parameters: "_models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> "_models.VirtualWAN": """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVirtualWANsResult"]: + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_connections_operations.py index 5ce1a3b68f88e..df888dc709b7c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( gateway_name: str, connection_name: str, **kwargs - ) -> "models.VpnConnection": + ) -> "_models.VpnConnection": """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> "models.VpnConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -169,9 +169,9 @@ async def begin_create_or_update( resource_group_name: str, gateway_name: str, connection_name: str, - vpn_connection_parameters: "models.VpnConnection", + vpn_connection_parameters: "_models.VpnConnection", **kwargs - ) -> AsyncLROPoller["models.VpnConnection"]: + ) -> AsyncLROPoller["_models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -328,7 +335,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -347,7 +361,7 @@ async def _start_packet_capture_initial( resource_group_name: str, gateway_name: str, vpn_connection_name: str, - parameters: Optional["models.VpnConnectionPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnConnectionPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -407,7 +421,7 @@ async def begin_start_packet_capture( resource_group_name: str, gateway_name: str, vpn_connection_name: str, - parameters: Optional["models.VpnConnectionPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnConnectionPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on Vpn connection in the specified resource group. @@ -458,7 +472,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -477,7 +498,7 @@ async def _stop_packet_capture_initial( resource_group_name: str, gateway_name: str, vpn_connection_name: str, - parameters: Optional["models.VpnConnectionPacketCaptureStopParameters"] = None, + parameters: Optional["_models.VpnConnectionPacketCaptureStopParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -537,7 +558,7 @@ async def begin_stop_packet_capture( resource_group_name: str, gateway_name: str, vpn_connection_name: str, - parameters: Optional["models.VpnConnectionPacketCaptureStopParameters"] = None, + parameters: Optional["_models.VpnConnectionPacketCaptureStopParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on Vpn connection in the specified resource group. @@ -588,7 +609,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -607,7 +635,7 @@ def list_by_vpn_gateway( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -619,7 +647,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_gateways_operations.py index 0c91030a391d4..f38a0d411433e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnGatewaysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": + ) -> "_models.VpnGateway": """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.VpnGateway", + vpn_gateway_parameters: "_models.VpnGateway", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -185,7 +185,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -210,7 +210,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -228,10 +234,10 @@ async def _update_tags_initial( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,9 +289,9 @@ async def begin_update_tags( self, resource_group_name: str, gateway_name: str, - vpn_gateway_parameters: "models.TagsObject", + vpn_gateway_parameters: "_models.TagsObject", **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -305,7 +311,7 @@ async def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -330,7 +336,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -432,7 +444,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -451,8 +469,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> Optional["models.VpnGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +518,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnGateway"]: + ) -> AsyncLROPoller["_models.VpnGateway"]: """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -518,7 +536,7 @@ async def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -560,7 +584,7 @@ async def _start_packet_capture_initial( self, resource_group_name: str, gateway_name: str, - parameters: Optional["models.VpnGatewayPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnGatewayPacketCaptureStartParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -618,7 +642,7 @@ async def begin_start_packet_capture( self, resource_group_name: str, gateway_name: str, - parameters: Optional["models.VpnGatewayPacketCaptureStartParameters"] = None, + parameters: Optional["_models.VpnGatewayPacketCaptureStartParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Starts packet capture on vpn gateway in the specified resource group. @@ -666,7 +690,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -684,7 +714,7 @@ async def _stop_packet_capture_initial( self, resource_group_name: str, gateway_name: str, - parameters: Optional["models.VpnGatewayPacketCaptureStopParameters"] = None, + parameters: Optional["_models.VpnGatewayPacketCaptureStopParameters"] = None, **kwargs ) -> Optional[str]: cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] @@ -742,7 +772,7 @@ async def begin_stop_packet_capture( self, resource_group_name: str, gateway_name: str, - parameters: Optional["models.VpnGatewayPacketCaptureStopParameters"] = None, + parameters: Optional["_models.VpnGatewayPacketCaptureStopParameters"] = None, **kwargs ) -> AsyncLROPoller[str]: """Stops packet capture on vpn gateway in the specified resource group. @@ -790,7 +820,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -808,7 +844,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -818,7 +854,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -877,7 +913,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnGatewaysResult"]: + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -885,7 +921,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_link_connections_operations.py index e30f29d5c3533..4ed3e46b3e0ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_vpn_connection( gateway_name: str, connection_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinkConnectionsResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -62,7 +62,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 78c0198666977..21a90562c3ddc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> Optional["models.VpnServerConfigurationsResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> AsyncLROPoller["models.VpnServerConfigurationsResponse"]: + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -115,7 +115,7 @@ async def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -139,7 +139,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_operations.py index d6f98c7061869..2ccfe5edeb695 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnServerConfigurationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.VpnServerConfiguration", + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", **kwargs - ) -> AsyncLROPoller["models.VpnServerConfiguration"]: + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -187,7 +187,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -212,7 +212,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -230,9 +236,9 @@ async def update_tags( self, resource_group_name: str, vpn_server_configuration_name: str, - vpn_server_configuration_parameters: "models.TagsObject", + vpn_server_configuration_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> "_models.VpnServerConfiguration": """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -247,7 +253,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -381,7 +387,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,7 +411,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -409,7 +421,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +480,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnServerConfigurationsResult"]: + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -476,7 +488,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_link_connections_operations.py index 86527b3b32260..3514b0be56fd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VpnSiteLinkConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( connection_name: str, link_connection_name: str, **kwargs - ) -> "models.VpnSiteLinkConnection": + ) -> "_models.VpnSiteLinkConnection": """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_links_operations.py index efb378126ee08..525f6bd05f487 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VpnSiteLinksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( vpn_site_name: str, vpn_site_link_name: str, **kwargs - ) -> "models.VpnSiteLink": + ) -> "_models.VpnSiteLink": """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -61,7 +61,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -108,7 +108,7 @@ def list_by_vpn_site( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSiteLinksResult"]: + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -120,7 +120,7 @@ def list_by_vpn_site( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_configuration_operations.py index 2388d24db687c..0434836f25b2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VpnSitesConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def _download_initial( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -96,7 +96,7 @@ async def begin_download( self, resource_group_name: str, virtual_wan_name: str, - request: "models.GetVpnSitesConfigurationRequest", + request: "_models.GetVpnSitesConfigurationRequest", **kwargs ) -> AsyncLROPoller[None]: """Gives the sas-url to download the configurations for vpn-sites in a resource group. @@ -141,7 +141,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_operations.py index 71c44f4eb813a..0a3f74e1cefcd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VpnSitesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -60,7 +60,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,10 +105,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> "models.VpnSite": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,9 +162,9 @@ async def begin_create_or_update( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.VpnSite", + vpn_site_parameters: "_models.VpnSite", **kwargs - ) -> AsyncLROPoller["models.VpnSite"]: + ) -> AsyncLROPoller["_models.VpnSite"]: """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -184,7 +184,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -209,7 +209,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -227,9 +233,9 @@ async def update_tags( self, resource_group_name: str, vpn_site_name: str, - vpn_site_parameters: "models.TagsObject", + vpn_site_parameters: "_models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> "_models.VpnSite": """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -243,7 +249,7 @@ async def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +383,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -395,7 +407,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -405,7 +417,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +476,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ListVpnSitesResult"]: + ) -> AsyncIterable["_models.ListVpnSitesResult"]: """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -472,7 +484,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_web_application_firewall_policies_operations.py index e98a9d8ac1797..c8aca3476e361 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class WebApplicationFirewallPoliciesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.WebApplicationFirewallPolicyListResult"]: + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -124,7 +124,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( resource_group_name: str, policy_name: str, **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,9 +241,9 @@ async def create_or_update( self, resource_group_name: str, policy_name: str, - parameters: "models.WebApplicationFirewallPolicy", + parameters: "_models.WebApplicationFirewallPolicy", **kwargs - ) -> "models.WebApplicationFirewallPolicy": + ) -> "_models.WebApplicationFirewallPolicy": """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ async def create_or_update( :rtype: ~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py index 72b6f1c297887..e77c1db7e5cf5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py @@ -7224,14 +7224,14 @@ class EffectiveRoutesParameters(msrest.serialization.Model): """The parameters specifying the resource whose effective routes are being requested. :param resource_id: The resource whose effective routes are being requested. - :type resource_id: ~azure.mgmt.network.v2020_06_01.models.Resource + :type resource_id: str :param virtual_wan_resource_type: The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. :type virtual_wan_resource_type: str """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'Resource'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'virtual_wan_resource_type': {'key': 'virtualWanResourceType', 'type': 'str'}, } @@ -10350,9 +10350,9 @@ class HubRouteTable(SubResource): :param labels: List of labels associated with this route table. :type labels: list[str] :ivar associated_connections: List of all connections associated with this route table. - :vartype associated_connections: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :vartype associated_connections: list[str] :ivar propagating_connections: List of all connections that advertise to this route table. - :vartype propagating_connections: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :vartype propagating_connections: list[str] :ivar provisioning_state: The provisioning state of the RouteTable resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.network.v2020_06_01.models.ProvisioningState @@ -10373,8 +10373,8 @@ class HubRouteTable(SubResource): 'type': {'key': 'type', 'type': 'str'}, 'routes': {'key': 'properties.routes', 'type': '[HubRoute]'}, 'labels': {'key': 'properties.labels', 'type': '[str]'}, - 'associated_connections': {'key': 'properties.associatedConnections', 'type': '[SubResource]'}, - 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[SubResource]'}, + 'associated_connections': {'key': 'properties.associatedConnections', 'type': '[str]'}, + 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[str]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py index 2dc854f49c773..faf0cebd03574 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py @@ -8055,21 +8055,21 @@ class EffectiveRoutesParameters(msrest.serialization.Model): """The parameters specifying the resource whose effective routes are being requested. :param resource_id: The resource whose effective routes are being requested. - :type resource_id: ~azure.mgmt.network.v2020_06_01.models.Resource + :type resource_id: str :param virtual_wan_resource_type: The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. :type virtual_wan_resource_type: str """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'Resource'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'virtual_wan_resource_type': {'key': 'virtualWanResourceType', 'type': 'str'}, } def __init__( self, *, - resource_id: Optional["Resource"] = None, + resource_id: Optional[str] = None, virtual_wan_resource_type: Optional[str] = None, **kwargs ): @@ -11524,9 +11524,9 @@ class HubRouteTable(SubResource): :param labels: List of labels associated with this route table. :type labels: list[str] :ivar associated_connections: List of all connections associated with this route table. - :vartype associated_connections: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :vartype associated_connections: list[str] :ivar propagating_connections: List of all connections that advertise to this route table. - :vartype propagating_connections: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :vartype propagating_connections: list[str] :ivar provisioning_state: The provisioning state of the RouteTable resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". :vartype provisioning_state: str or ~azure.mgmt.network.v2020_06_01.models.ProvisioningState @@ -11547,8 +11547,8 @@ class HubRouteTable(SubResource): 'type': {'key': 'type', 'type': 'str'}, 'routes': {'key': 'properties.routes', 'type': '[HubRoute]'}, 'labels': {'key': 'properties.labels', 'type': '[str]'}, - 'associated_connections': {'key': 'properties.associatedConnections', 'type': '[SubResource]'}, - 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[SubResource]'}, + 'associated_connections': {'key': 'properties.associatedConnections', 'type': '[str]'}, + 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[str]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_endpoint_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_endpoint_connections_operations.py index c9223a84ae3d5..6e942282a0106 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_endpoint_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_endpoint_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewayPrivateEndpointConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -162,11 +169,11 @@ def _update_initial( resource_group_name, # type: str application_gateway_name, # type: str connection_name, # type: str - parameters, # type: "models.ApplicationGatewayPrivateEndpointConnection" + parameters, # type: "_models.ApplicationGatewayPrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayPrivateEndpointConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayPrivateEndpointConnection"]] + # type: (...) -> Optional["_models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayPrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +227,10 @@ def begin_update( resource_group_name, # type: str application_gateway_name, # type: str connection_name, # type: str - parameters, # type: "models.ApplicationGatewayPrivateEndpointConnection" + parameters, # type: "_models.ApplicationGatewayPrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayPrivateEndpointConnection"] + # type: (...) -> LROPoller["_models.ApplicationGatewayPrivateEndpointConnection"] """Updates the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -246,7 +253,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -272,7 +279,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -293,7 +307,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayPrivateEndpointConnection" + # type: (...) -> "_models.ApplicationGatewayPrivateEndpointConnection" """Gets the specified private endpoint connection on application gateway. :param resource_group_name: The name of the resource group. @@ -307,7 +321,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +369,7 @@ def list( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] """Lists all private endpoint connections on an application gateway. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_link_resources_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_link_resources_operations.py index 3a424151d95ad..2d297f4213144 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_link_resources_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_link_resources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ApplicationGatewayPrivateLinkResourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayPrivateLinkResourceListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayPrivateLinkResourceListResult"] """Lists all private link resources on an application gateway. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py index 8ec214122143e..86b7eb6491689 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Gets the specified application gateway. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.ApplicationGateway" + parameters, # type: "_models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGateway"] + # type: (...) -> LROPoller["_models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str application_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGateway" + # type: (...) -> "_models.ApplicationGateway" """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Lists all application gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayListResult"] + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] """Gets all the application gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +641,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -733,7 +751,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -754,8 +778,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -807,7 +831,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealth"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] """Gets the backend health of the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -827,7 +851,7 @@ def begin_backend_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -852,7 +876,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -870,12 +900,12 @@ def _backend_health_on_demand_initial( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,11 +959,11 @@ def begin_backend_health_on_demand( self, resource_group_name, # type: str application_gateway_name, # type: str - probe_request, # type: "models.ApplicationGatewayOnDemandProbe" + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] """Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group. @@ -956,7 +986,7 @@ def begin_backend_health_on_demand( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -982,7 +1012,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1037,7 +1073,7 @@ def list_available_server_variables( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1089,7 +1125,7 @@ def list_available_request_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1141,7 +1177,7 @@ def list_available_response_headers( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[str]', pipeline_response) @@ -1156,7 +1192,7 @@ def list_available_waf_rule_sets( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableWafRuleSetsResult" + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" """Lists all available web application firewall rule sets. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1164,7 +1200,7 @@ def list_available_waf_rule_sets( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1207,7 +1243,7 @@ def list_available_ssl_options( self, **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayAvailableSslOptions" + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" """Lists available Ssl options for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1215,7 +1251,7 @@ def list_available_ssl_options( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayAvailableSslOptions :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1258,7 +1294,7 @@ def list_available_ssl_predefined_policies( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] """Lists all SSL predefined policies for configuring Ssl policy. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1266,7 +1302,7 @@ def list_available_ssl_predefined_policies( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1326,7 +1362,7 @@ def get_ssl_predefined_policy( predefined_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewaySslPredefinedPolicy" + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" """Gets Ssl predefined policy with the specified policy name. :param predefined_policy_name: Name of Ssl predefined policy. @@ -1336,7 +1372,7 @@ def get_ssl_predefined_policy( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySslPredefinedPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_security_groups_operations.py index f4719aeadfb99..266f92f3573b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ApplicationSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Gets information about the specified application security group. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.ApplicationSecurityGroup" + parameters, # type: "_models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str application_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ApplicationSecurityGroup" + # type: (...) -> "_models.ApplicationSecurityGroup" """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all application security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -414,7 +426,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +486,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ApplicationSecurityGroupListResult"] + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] """Gets all the application security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ApplicationSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py index c59b0577fb61b..d37afaf47a07b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this subscription in this region. :param location: The location of the subnet. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_endpoint_services_operations.py index 0df33fdce9501..ec137495d9af0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_endpoint_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_endpoint_services_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableEndpointServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EndpointServicesListResult"] + # type: (...) -> Iterable["_models.EndpointServicesListResult"] """List what values of endpoint services are available for use. :param location: The location to check available endpoint services. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.EndpointServicesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_private_endpoint_types_operations.py index a5d7b4ffce56f..83eec4a209f1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_private_endpoint_types_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_private_endpoint_types_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailablePrivateEndpointTypesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailablePrivateEndpointTypesResult"] + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] """Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. @@ -136,7 +136,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailablePrivateEndpointTypesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_resource_group_delegations_operations.py index b66b7f5c6e8e0..87022274a7d25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_resource_group_delegations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_resource_group_delegations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableResourceGroupDelegationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableDelegationsResult"] + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] """Gets all of the available subnet delegations for this resource group in this region. :param location: The location of the domain name. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableDelegationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_service_aliases_operations.py index 32fe34f3ae522..01014b2b27c84 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_service_aliases_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_service_aliases_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailableServiceAliasesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this subscription in this region. :param location: The location. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_by_resource_group( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailableServiceAliasesResult"] + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] """Gets all available service aliases for this resource group in this region. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AvailableServiceAliasesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewall_fqdn_tags_operations.py index 5c968642dd02b..c578460987ab7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewall_fqdn_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AzureFirewallFqdnTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallFqdnTagListResult"] + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] """Gets all the Azure Firewall FQDN Tags in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AzureFirewallFqdnTagListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py index a03c317057bfa..9c3401d98938f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class AzureFirewallsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" + # type: (...) -> "_models.AzureFirewall" """Gets the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.AzureFirewall :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.AzureFirewall" + parameters, # type: "_models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.AzureFirewall"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] + # type: (...) -> Optional["_models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str azure_firewall_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureFirewall"] + # type: (...) -> LROPoller["_models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Lists all Azure Firewalls in a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -531,7 +549,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureFirewallListResult"] + # type: (...) -> Iterable["_models.AzureFirewallListResult"] """Gets all the Azure Firewalls in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -539,7 +557,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AzureFirewallListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py index 12e937c538864..6f76f44a758d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class BastionHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" + # type: (...) -> "_models.BastionHost" """Gets the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> "models.BastionHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str bastion_host_name, # type: str - parameters, # type: "models.BastionHost" + parameters, # type: "_models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BastionHost"] + # type: (...) -> LROPoller["_models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,7 +350,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +358,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionHostListResult"] + # type: (...) -> Iterable["_models.BastionHostListResult"] """Lists all Bastion Hosts in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bgp_service_communities_operations.py index 2c048eb1f547c..04a308da005a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bgp_service_communities_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bgp_service_communities_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BgpServiceCommunitiesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.BgpServiceCommunityListResult"] + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] """Gets all the available bgp service communities. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BgpServiceCommunityListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py index 13805cf134665..7af61de42b8c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ConnectionMonitorsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.ConnectionMonitor" + parameters, # type: "_models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -185,7 +192,7 @@ def get( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Gets a connection monitor by name. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -199,7 +206,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +238,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -282,7 +289,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -339,7 +346,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -358,10 +372,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str connection_monitor_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorResult" + # type: (...) -> "_models.ConnectionMonitorResult" """Update tags of the specified connection monitor. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +428,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -465,7 +479,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -522,7 +536,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -576,7 +597,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -633,7 +654,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -654,8 +682,8 @@ def _query_initial( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionMonitorQueryResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +715,7 @@ def _query_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -709,7 +737,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionMonitorQueryResult"] + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -729,7 +757,7 @@ def begin_query( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorQueryResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +782,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -774,7 +809,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConnectionMonitorListResult"] + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] """Lists all connection monitors for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -786,7 +821,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +868,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_custom_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_custom_ip_prefixes_operations.py index 8481461709e95..e00188576f323 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_custom_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_custom_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class CustomIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.CustomIpPrefix" + # type: (...) -> "_models.CustomIpPrefix" """Gets the specified custom IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.CustomIpPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str custom_ip_prefix_name, # type: str - parameters, # type: "models.CustomIpPrefix" + parameters, # type: "_models.CustomIpPrefix" **kwargs # type: Any ): - # type: (...) -> "models.CustomIpPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + # type: (...) -> "_models.CustomIpPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str custom_ip_prefix_name, # type: str - parameters, # type: "models.CustomIpPrefix" + parameters, # type: "_models.CustomIpPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.CustomIpPrefix"] + # type: (...) -> LROPoller["_models.CustomIpPrefix"] """Creates or updates a custom IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str custom_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.CustomIpPrefix" + # type: (...) -> "_models.CustomIpPrefix" """Updates custom IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.CustomIpPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.CustomIpPrefixListResult"] + # type: (...) -> Iterable["_models.CustomIpPrefixListResult"] """Gets all the custom IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.CustomIpPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.CustomIpPrefixListResult"] + # type: (...) -> Iterable["_models.CustomIpPrefixListResult"] """Gets all custom IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.CustomIpPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_custom_policies_operations.py index f3da9b15b0685..ee89da1a18d22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_custom_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_custom_policies_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class DdosCustomPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -136,7 +136,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -156,7 +162,7 @@ def get( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Gets information about the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -168,7 +174,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,11 +219,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -271,10 +277,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.DdosCustomPolicy" + parameters, # type: "_models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosCustomPolicy"] + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -294,7 +300,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -319,7 +325,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,10 +349,10 @@ def update_tags( self, resource_group_name, # type: str ddos_custom_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosCustomPolicy" + # type: (...) -> "_models.DdosCustomPolicy" """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosCustomPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_protection_plans_operations.py index b3e6e5e42f19a..a75fbcd3fc497 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_protection_plans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_protection_plans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DdosProtectionPlansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Gets information about the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.DdosProtectionPlan" + parameters, # type: "_models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DdosProtectionPlan"] + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str ddos_protection_plan_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.DdosProtectionPlan" + # type: (...) -> "_models.DdosProtectionPlan" """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all DDoS protection plans in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DdosProtectionPlanListResult"] + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] """Gets all the DDoS protection plans in a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.DdosProtectionPlanListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_default_security_rules_operations.py index 96437aa8ee13b..c2756e06cd990 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_default_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_default_security_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DefaultSecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all default security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( default_security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified default network security rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py index 9d5db82ab21d1..fb7ef735fb4d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DscpConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str dscp_configuration_name, # type: str - parameters, # type: "models.DscpConfiguration" + parameters, # type: "_models.DscpConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.DscpConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + # type: (...) -> "_models.DscpConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str dscp_configuration_name, # type: str - parameters, # type: "models.DscpConfiguration" + parameters, # type: "_models.DscpConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DscpConfiguration"] + # type: (...) -> LROPoller["_models.DscpConfiguration"] """Creates or updates a DSCP Configuration. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -261,7 +267,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -281,7 +293,7 @@ def get( dscp_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DscpConfiguration" + # type: (...) -> "_models.DscpConfiguration" """Gets a DSCP Configuration. :param resource_group_name: The name of the resource group. @@ -293,7 +305,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.DscpConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -339,7 +351,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DscpConfigurationListResult"] + # type: (...) -> Iterable["_models.DscpConfigurationListResult"] """Gets a DSCP Configuration. :param resource_group_name: The name of the resource group. @@ -349,7 +361,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.DscpConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,7 +421,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DscpConfigurationListResult"] + # type: (...) -> Iterable["_models.DscpConfigurationListResult"] """Gets all dscp configurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -417,7 +429,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.DscpConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_authorizations_operations.py index 4182c7ce58cbc..e4bb24e05ca00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_authorizations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_authorizations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" """Gets the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitAuthorization :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str authorization_name, # type: str - authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitAuthorization"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] """Creates or updates an authorization in the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationListResult"] + # type: (...) -> Iterable["_models.AuthorizationListResult"] """Gets all authorizations in an express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AuthorizationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_connections_operations.py index bbd7f79718253..a564db53f811d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -150,7 +150,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -172,7 +180,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" + # type: (...) -> "_models.ExpressRouteCircuitConnection" """Gets the specified Express Route Circuit Connection from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +196,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,11 +245,11 @@ def _create_or_update_initial( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,10 +307,10 @@ def begin_create_or_update( circuit_name, # type: str peering_name, # type: str connection_name, # type: str - express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] """Creates or updates a Express Route Circuit Connection in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -327,7 +335,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -354,7 +362,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,7 +391,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] """Gets all global reach connections associated with a private peering in an express route circuit. @@ -390,7 +406,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_peerings_operations.py index 3e875aebf220d..ac6843aa61fd6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" + # type: (...) -> "_models.ExpressRouteCircuitPeering" """Gets the specified peering for the express route circuit. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str circuit_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCircuitPeering" + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitPeeringListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] """Gets all peerings in a specified express route circuit. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py index 89f8eb3a97340..0a308e056a865 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCircuitsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Gets information about the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.ExpressRouteCircuit" + parameters, # type: "_models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuit"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str circuit_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuit" + # type: (...) -> "_models.ExpressRouteCircuit" """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuit :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -409,8 +421,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +475,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -486,7 +498,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -512,7 +524,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -534,8 +554,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -588,7 +608,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -611,7 +631,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +657,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -659,8 +687,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -713,7 +741,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -736,7 +764,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -762,7 +790,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -782,7 +818,7 @@ def get_stats( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all the stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -794,7 +830,7 @@ def get_stats( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -842,7 +878,7 @@ def get_peering_stats( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitStats" + # type: (...) -> "_models.ExpressRouteCircuitStats" """Gets all stats from an express route circuit in a resource group. :param resource_group_name: The name of the resource group. @@ -856,7 +892,7 @@ def get_peering_stats( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitStats :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -903,7 +939,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a resource group. :param resource_group_name: The name of the resource group. @@ -913,7 +949,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -973,7 +1009,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCircuitListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] """Gets all the express route circuits in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -981,7 +1017,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_connections_operations.py index 0201986988682..053da139a1a21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_connections_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str express_route_gateway_name, # type: str connection_name, # type: str - put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnection" + # type: (...) -> "_models.ExpressRouteConnection" """Gets the specified ExpressRouteConnection. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteConnectionList" + # type: (...) -> "_models.ExpressRouteConnectionList" """Lists ExpressRouteConnections. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteConnectionList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py index 9a9c16ba3b776..28bbde1f1a2a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionPeeringList"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] """Gets all peerings in a specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionPeeringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -239,7 +246,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" """Gets the specified peering for the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -253,7 +260,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,11 +307,11 @@ def _create_or_update_initial( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,10 +367,10 @@ def begin_create_or_update( resource_group_name, # type: str cross_connection_name, # type: str peering_name, # type: str - peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -386,7 +393,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connections_operations.py index 9b3bdfe0c09e9..17f6bbb00cf75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRouteCrossConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteCrossConnectionListResult"] + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] """Retrieves all the ExpressRouteCrossConnections in a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( cross_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Gets details about the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group (peering location of the circuit). @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,11 +249,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +303,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cross_connection_name, # type: str - parameters, # type: "models.ExpressRouteCrossConnection" + parameters, # type: "_models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -326,7 +326,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +351,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -369,10 +375,10 @@ def update_tags( self, resource_group_name, # type: str cross_connection_name, # type: str - cross_connection_parameters, # type: "models.TagsObject" + cross_connection_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnection" + # type: (...) -> "_models.ExpressRouteCrossConnection" """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -387,7 +393,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteCrossConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,8 +447,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -495,7 +501,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -518,7 +524,7 @@ def begin_list_arp_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -544,7 +550,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -566,8 +580,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -620,7 +634,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -643,7 +657,7 @@ def begin_list_routes_table_summary( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -669,7 +683,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -691,8 +713,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +767,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -768,7 +790,7 @@ def begin_list_routes_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -794,7 +816,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_gateways_operations.py index d598c747ff25f..2ffec29244aef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_gateways_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class ExpressRouteGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways under a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGatewayList" + # type: (...) -> "_models.ExpressRouteGatewayList" """Lists ExpressRoute gateways in a given resource group. :param resource_group_name: The name of the resource group. @@ -112,7 +112,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteGatewayList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,11 +156,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,10 +214,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_gateway_name, # type: str - put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRouteGateway"] + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] """Creates or updates a ExpressRoute gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -238,7 +238,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +263,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,7 +289,7 @@ def get( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteGateway" + # type: (...) -> "_models.ExpressRouteGateway" """Fetches the details of a ExpressRoute gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +433,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_links_operations.py index 54a3a5c8fa1c4..b2a9d92206fe8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteLink" + # type: (...) -> "_models.ExpressRouteLink" """Retrieves the specified ExpressRouteLink resource. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRouteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteLinkListResult"] + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_locations_operations.py index 663d1ca2e5384..e11b25fa7d666 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_locations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_locations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRoutePortsLocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortsLocationListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortsLocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def get( location_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePortsLocation" + # type: (...) -> "_models.ExpressRoutePortsLocation" """Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. @@ -130,7 +130,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortsLocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_operations.py index cccf62982af78..3c361a91c065b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ExpressRoutePortsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Retrieves the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.ExpressRoutePort" + parameters, # type: "_models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ExpressRoutePort"] + # type: (...) -> LROPoller["_models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str express_route_port_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ExpressRoutePort" + # type: (...) -> "_models.ExpressRoutePort" """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ExpressRoutePort :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRoutePortListResult"] + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] """List all the ExpressRoutePort resources in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRoutePortListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,10 +555,10 @@ def generate_loa( self, resource_group_name, # type: str express_route_port_name, # type: str - request, # type: "models.GenerateExpressRoutePortsLOARequest" + request, # type: "_models.GenerateExpressRoutePortsLOARequest" **kwargs # type: Any ): - # type: (...) -> "models.GenerateExpressRoutePortsLOAResult" + # type: (...) -> "_models.GenerateExpressRoutePortsLOAResult" """Generate a letter of authorization for the requested ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -560,7 +572,7 @@ def generate_loa( :rtype: ~azure.mgmt.network.v2020_06_01.models.GenerateExpressRoutePortsLOAResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateExpressRoutePortsLOAResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateExpressRoutePortsLOAResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_service_providers_operations.py index 56d47dc7ccb21..e9caa5b8fd4bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_service_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_service_providers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ExpressRouteServiceProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ExpressRouteServiceProviderListResult"] + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] """Gets all the available express route service providers. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ExpressRouteServiceProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py index ef30d2dce80d5..1a38aa10c79eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" + # type: (...) -> "_models.FirewallPolicy" """Gets the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str firewall_policy_name, # type: str - parameters, # type: "models.FirewallPolicy" + parameters, # type: "_models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicy"] + # type: (...) -> LROPoller["_models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,7 +356,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Lists all Firewall Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -354,7 +366,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] """Gets all the Firewall Policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -422,7 +434,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.FirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policy_rule_collection_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policy_rule_collection_groups_operations.py index 6c4578f37bccb..1311d3434d17b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policy_rule_collection_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policy_rule_collection_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FirewallPolicyRuleCollectionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_collection_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleCollectionGroup" + # type: (...) -> "_models.FirewallPolicyRuleCollectionGroup" """Gets the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FirewallPolicyRuleCollectionGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str firewall_policy_name, # type: str rule_collection_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleCollectionGroup" + parameters, # type: "_models.FirewallPolicyRuleCollectionGroup" **kwargs # type: Any ): - # type: (...) -> "models.FirewallPolicyRuleCollectionGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + # type: (...) -> "_models.FirewallPolicyRuleCollectionGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str firewall_policy_name, # type: str rule_collection_group_name, # type: str - parameters, # type: "models.FirewallPolicyRuleCollectionGroup" + parameters, # type: "_models.FirewallPolicyRuleCollectionGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FirewallPolicyRuleCollectionGroup"] + # type: (...) -> LROPoller["_models.FirewallPolicyRuleCollectionGroup"] """Creates or updates the specified FirewallPolicyRuleCollectionGroup. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FirewallPolicyRuleCollectionGroupListResult"] + # type: (...) -> Iterable["_models.FirewallPolicyRuleCollectionGroupListResult"] """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.FirewallPolicyRuleCollectionGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py index 8074a7beb6905..c037f25086ffd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class FlowLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -113,10 +113,10 @@ def begin_create_or_update( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.FlowLog" + parameters, # type: "_models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLog"] + # type: (...) -> LROPoller["_models.FlowLog"] """Create or update a flow log for the specified network security group. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -183,10 +190,10 @@ def update_tags( resource_group_name, # type: str network_watcher_name, # type: str flow_log_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Update tags of the specified flow log. :param resource_group_name: The name of the resource group. @@ -202,7 +209,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +246,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -257,7 +264,7 @@ def get( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FlowLog" + # type: (...) -> "_models.FlowLog" """Gets a flow log resource by name. :param resource_group_name: The name of the resource group. @@ -271,7 +278,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FlowLog :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,7 +310,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FlowLog', pipeline_response) @@ -354,7 +361,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -411,7 +418,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -431,7 +445,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.FlowLogListResult"] + # type: (...) -> Iterable["_models.FlowLogListResult"] """Lists all flow log resources for the specified Network Watcher. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -443,7 +457,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.FlowLogListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -490,7 +504,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_route_tables_operations.py index 52a4dff71c29c..7ae53dd170176 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class HubRouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - route_table_parameters, # type: "models.HubRouteTable" + route_table_parameters, # type: "_models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> "models.HubRouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + # type: (...) -> "_models.HubRouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - route_table_parameters, # type: "models.HubRouteTable" + route_table_parameters, # type: "_models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubRouteTable"] + # type: (...) -> LROPoller["_models.HubRouteTable"] """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -184,7 +191,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubRouteTable" + # type: (...) -> "_models.HubRouteTable" """Retrieves the details of a RouteTable. :param resource_group_name: The resource group name of the VirtualHub. @@ -198,7 +205,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.HubRouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubRouteTablesResult"] + # type: (...) -> Iterable["_models.ListHubRouteTablesResult"] """Retrieves the details of all RouteTables. :param resource_group_name: The resource group name of the VirtualHub. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListHubRouteTablesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_virtual_network_connections_operations.py index b335f0bbdc12f..6f68ffe060290 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_virtual_network_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_virtual_network_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class HubVirtualNetworkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - hub_virtual_network_connection_parameters, # type: "models.HubVirtualNetworkConnection" + hub_virtual_network_connection_parameters, # type: "_models.HubVirtualNetworkConnection" **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + # type: (...) -> "_models.HubVirtualNetworkConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - hub_virtual_network_connection_parameters, # type: "models.HubVirtualNetworkConnection" + hub_virtual_network_connection_parameters, # type: "_models.HubVirtualNetworkConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubVirtualNetworkConnection"] + # type: (...) -> LROPoller["_models.HubVirtualNetworkConnection"] """Creates a hub virtual network connection if it doesn't exist else updates the existing one. :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -274,7 +281,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -295,7 +309,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubVirtualNetworkConnection" + # type: (...) -> "_models.HubVirtualNetworkConnection" """Retrieves the details of a HubVirtualNetworkConnection. :param resource_group_name: The resource group name of the VirtualHub. @@ -309,7 +323,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.HubVirtualNetworkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +371,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListHubVirtualNetworkConnectionsResult"] + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] """Retrieves the details of all HubVirtualNetworkConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListHubVirtualNetworkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_nat_rules_operations.py index 565f8e2b4f67f..1014bf7140a74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_nat_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_nat_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class InboundNatRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.InboundNatRuleListResult"] + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] """Gets all the inbound nat rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.InboundNatRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -218,7 +218,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -240,7 +247,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" + # type: (...) -> "_models.InboundNatRule" """Gets the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -256,7 +263,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.InboundNatRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -305,11 +312,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,10 +372,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "models.InboundNatRule" + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundNatRule"] + # type: (...) -> LROPoller["_models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -391,7 +398,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -417,7 +424,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_security_rule_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_security_rule_operations.py index 9acbb584d7eb8..e5d576a76bbb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_security_rule_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_security_rule_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class InboundSecurityRuleOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_virtual_appliance_name, # type: str rule_collection_name, # type: str - parameters, # type: "models.InboundSecurityRule" + parameters, # type: "_models.InboundSecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.InboundSecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundSecurityRule"] + # type: (...) -> "_models.InboundSecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str network_virtual_appliance_name, # type: str rule_collection_name, # type: str - parameters, # type: "models.InboundSecurityRule" + parameters, # type: "_models.InboundSecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.InboundSecurityRule"] + # type: (...) -> LROPoller["_models.InboundSecurityRule"] """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.InboundSecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'ruleCollectionName': self._serialize.url("rule_collection_name", rule_collection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py index c5c24a9153e76..f6839eabb5cb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpAllocationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Gets the specified IpAllocation by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + # type: (...) -> "_models.IpAllocation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.IpAllocation" + parameters, # type: "_models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpAllocation"] + # type: (...) -> LROPoller["_models.IpAllocation"] """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str ip_allocation_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpAllocation" + # type: (...) -> "_models.IpAllocation" """Updates a IpAllocation tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpAllocation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpAllocationListResult"] + # type: (...) -> Iterable["_models.IpAllocationListResult"] """Gets all IpAllocations in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.IpAllocationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py index 4323342c3dc70..adb759b4a39b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class IpGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Gets the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -117,11 +117,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -176,10 +176,10 @@ def begin_create_or_update( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.IpGroup" + parameters, # type: "_models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.IpGroup"] + # type: (...) -> LROPoller["_models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -242,10 +248,10 @@ def update_groups( self, resource_group_name, # type: str ip_groups_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.IpGroup" + # type: (...) -> "_models.IpGroup" """Updates tags of an IpGroups resource. :param resource_group_name: The name of the resource group. @@ -259,7 +265,7 @@ def update_groups( :rtype: ~azure.mgmt.network.v2020_06_01.models.IpGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +301,7 @@ def update_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpGroup', pipeline_response) @@ -344,7 +350,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -397,7 +403,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,7 +428,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a resource group. :param resource_group_name: The name of the resource group. @@ -426,7 +438,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -472,7 +484,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -487,7 +499,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpGroupListResult"] + # type: (...) -> Iterable["_models.IpGroupListResult"] """Gets all IpGroups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +507,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.IpGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,7 +552,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_backend_address_pools_operations.py index 4d2229340718a..b613c6e6a5cc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_backend_address_pools_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_backend_address_pools_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerBackendAddressPoolListResult"] + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] """Gets all the load balancer backed address pools. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerBackendAddressPoolListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -129,7 +129,7 @@ def get( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" + # type: (...) -> "_models.BackendAddressPool" """Gets load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.BackendAddressPool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,11 +190,11 @@ def _create_or_update_initial( resource_group_name, # type: str load_balancer_name, # type: str backend_address_pool_name, # type: str - parameters, # type: "models.BackendAddressPool" + parameters, # type: "_models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> "models.BackendAddressPool" - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + # type: (...) -> "_models.BackendAddressPool" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -250,10 +250,10 @@ def begin_create_or_update( resource_group_name, # type: str load_balancer_name, # type: str backend_address_pool_name, # type: str - parameters, # type: "models.BackendAddressPool" + parameters, # type: "_models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BackendAddressPool"] + # type: (...) -> LROPoller["_models.BackendAddressPool"] """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -276,7 +276,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -302,7 +302,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -412,7 +419,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py index 6e47420c33217..b0c43d28c4794 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerFrontendIPConfigurationListResult"] + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] """Gets all the load balancer frontend IP configurations. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerFrontendIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( frontend_ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.FrontendIPConfiguration" + # type: (...) -> "_models.FrontendIPConfiguration" """Gets load balancer frontend IP configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.FrontendIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_load_balancing_rules_operations.py index 06b433450583f..09af574210e78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_load_balancing_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerLoadBalancingRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] """Gets all the load balancing rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerLoadBalancingRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( load_balancing_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancingRule" + # type: (...) -> "_models.LoadBalancingRule" """Gets the specified load balancer load balancing rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.LoadBalancingRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_network_interfaces_operations.py index ccb6568d088ba..0d4455d28578e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_network_interfaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets associated load balancer network interfaces. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_outbound_rules_operations.py index 9ef4bca45bd3a..a6cfb67e036d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_outbound_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_outbound_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerOutboundRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerOutboundRuleListResult"] + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( outbound_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OutboundRule" + # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_probes_operations.py index 945846cc8dfd0..62b486f28e728 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_probes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_probes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LoadBalancerProbesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerProbeListResult"] + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] """Gets all the load balancer probes. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerProbeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( probe_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Probe" + # type: (...) -> "_models.Probe" """Gets load balancer probe. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.Probe :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py index 3ba3ccf3176a4..ee16337326003 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Gets the specified load balancer. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.LoadBalancer" + parameters, # type: "_models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LoadBalancer"] + # type: (...) -> LROPoller["_models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str load_balancer_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LoadBalancer" + # type: (...) -> "_models.LoadBalancer" """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.LoadBalancer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LoadBalancerListResult"] + # type: (...) -> Iterable["_models.LoadBalancerListResult"] """Gets all the load balancers in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_local_network_gateways_operations.py index 5aba9df0e5339..78c3f34668ed6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_local_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_local_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LocalNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.LocalNetworkGateway" + parameters, # type: "_models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LocalNetworkGateway"] + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] """Creates or updates a local network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Gets the specified local network gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str local_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.LocalNetworkGateway" + # type: (...) -> "_models.LocalNetworkGateway" """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.LocalNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -406,7 +418,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.LocalNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] """Gets all the local network gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -416,7 +428,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.LocalNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py index ac841b3428db8..eda7bcbc4f32f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NatGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Gets the specified nat gateway in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + # type: (...) -> Optional["_models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NatGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,15 +267,13 @@ def _create_or_update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + deserialized = None if response.status_code == 200: deserialized = self._deserialize('NatGateway', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('NatGateway', pipeline_response) - if response.status_code == 202: - deserialized = self._deserialize('NatGateway', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) @@ -280,10 +284,10 @@ def begin_create_or_update( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.NatGateway" + parameters, # type: "_models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NatGateway"] + # type: (...) -> LROPoller["_models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -303,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -346,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str nat_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NatGateway" + # type: (...) -> "_models.NatGateway" """Updates nat gateway tags. :param resource_group_name: The name of the resource group. @@ -363,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NatGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all the Nat Gateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NatGatewayListResult"] + # type: (...) -> Iterable["_models.NatGatewayListResult"] """Gets all nat gateways in a resource group. :param resource_group_name: The name of the resource group. @@ -491,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NatGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_ip_configurations_operations.py index 736043057a72c..993b1a7a0f418 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_ip_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_ip_configurations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get all ip configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Gets the specified network interface ip configuration. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_load_balancers_operations.py index 3f4d9aea1fd41..60f9528658f0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_load_balancers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_load_balancers_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceLoadBalancerListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] """List all load balancers in a network interface. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceLoadBalancerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_tap_configurations_operations.py index a56afee98c6b1..10cbdd8dc7912 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_tap_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_tap_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfaceTapConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" """Get the specified tap configuration on a network interface. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceTapConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceTapConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_interface_name, # type: str tap_configuration_name, # type: str - tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceTapConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] """Get all Tap configurations in a network interface. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceTapConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_operations.py index fe1d445570a08..3ea6900b3e875 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkInterfacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Gets information about the specified network interface. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.NetworkInterface" + parameters, # type: "_models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkInterface"] + # type: (...) -> LROPoller["_models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str network_interface_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,8 +562,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -600,7 +612,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveRouteListResult"] + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -618,7 +630,7 @@ def begin_get_effective_route_table( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -642,7 +654,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -662,8 +680,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -712,7 +730,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -730,7 +748,7 @@ def begin_list_effective_network_security_groups( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +772,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -775,7 +799,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( virtualmachine_index, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @@ -790,7 +814,7 @@ def list_virtual_machine_scale_set_vm_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +878,7 @@ def list_virtual_machine_scale_set_network_interfaces( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] """Gets all network interfaces in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -866,7 +890,7 @@ def list_virtual_machine_scale_set_network_interfaces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -932,7 +956,7 @@ def get_virtual_machine_scale_set_network_interface( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterface" + # type: (...) -> "_models.NetworkInterface" """Get the specified network interface in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -950,7 +974,7 @@ def get_virtual_machine_scale_set_network_interface( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterface :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1028,7 @@ def list_virtual_machine_scale_set_ip_configurations( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkInterfaceIPConfigurationListResult"] + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1022,7 +1046,7 @@ def list_virtual_machine_scale_set_ip_configurations( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1117,7 @@ def get_virtual_machine_scale_set_ip_configuration( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkInterfaceIPConfiguration" + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" """Get the specified network interface ip configuration in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -1113,7 +1137,7 @@ def get_virtual_machine_scale_set_ip_configuration( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_management_client_operations.py index 56e4b0a405cf3..a678429730848 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_management_client_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_management_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,11 +31,11 @@ def _put_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionShareableLinkListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,10 +87,10 @@ def begin_put_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionShareableLinkListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] """Creates a Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -109,7 +109,7 @@ def begin_put_bastion_shareable_link( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,7 +170,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -197,7 +197,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -215,7 +221,7 @@ def _delete_bastion_shareable_link_initial( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> None @@ -266,7 +272,7 @@ def begin_delete_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -311,7 +317,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -329,10 +341,10 @@ def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + bsl_request, # type: "_models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionShareableLinkListResult"] + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] """Return the Bastion Shareable Links for all the VMs specified in the request. :param resource_group_name: The name of the resource group. @@ -346,7 +358,7 @@ def get_bastion_shareable_link( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,8 +429,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.BastionActiveSessionListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +479,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.BastionActiveSessionListResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -484,7 +496,7 @@ def begin_get_active_sessions( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -537,7 +549,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -563,7 +575,13 @@ def internal_get_next(next_link=None): return ItemPaged( internal_get_next, extract_data ) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -581,10 +599,10 @@ def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" + session_ids, # type: "_models.SessionIds" **kwargs # type: Any ): - # type: (...) -> Iterable["models.BastionSessionDeleteResult"] + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -598,7 +616,7 @@ def disconnect_active_sessions( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -669,7 +687,7 @@ def check_dns_name_availability( domain_name_label, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DnsNameAvailabilityResult" + # type: (...) -> "_models.DnsNameAvailabilityResult" """Checks whether a domain name in the cloudapp.azure.com zone is available for use. :param location: The location of the domain name. @@ -682,7 +700,7 @@ def check_dns_name_availability( :rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +747,7 @@ def supported_security_providers( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWanSecurityProviders" + # type: (...) -> "_models.VirtualWanSecurityProviders" """Gives the supported security providers for the virtual wan. :param resource_group_name: The resource group name. @@ -742,7 +760,7 @@ def supported_security_providers( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,11 +805,11 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -843,10 +861,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -869,7 +887,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -894,7 +912,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py index 1d006b4227065..b5344489bf253 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Gets the specified network profile in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def create_or_update( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.NetworkProfile" + parameters, # type: "_models.NetworkProfile" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Creates or updates a network profile. :param resource_group_name: The name of the resource group. @@ -236,7 +242,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +296,10 @@ def update_tags( self, resource_group_name, # type: str network_profile_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkProfile" + # type: (...) -> "_models.NetworkProfile" """Updates network profile tags. :param resource_group_name: The name of the resource group. @@ -307,7 +313,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkProfile :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +363,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all the network profiles in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -365,7 +371,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +431,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkProfileListResult"] + # type: (...) -> Iterable["_models.NetworkProfileListResult"] """Gets all network profiles in a resource group. :param resource_group_name: The name of the resource group. @@ -435,7 +441,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkProfileListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_security_groups_operations.py index 9298b38233775..6a9440501668f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_security_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_security_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkSecurityGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Gets the specified network security group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.NetworkSecurityGroup" + parameters, # type: "_models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkSecurityGroup"] + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] """Creates or updates a network security group in the specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str network_security_group_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkSecurityGroup" + # type: (...) -> "_models.NetworkSecurityGroup" """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkSecurityGroupListResult"] + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] """Gets all network security groups in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkSecurityGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_virtual_appliances_operations.py index 4fc53a996720e..7500273e0edb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_virtual_appliances_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_virtual_appliances_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkVirtualAppliancesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Gets the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +225,10 @@ def update_tags( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" + # type: (...) -> "_models.NetworkVirtualAppliance" """Updates a Network Virtual Appliance. :param resource_group_name: The resource group name of Network Virtual Appliance. @@ -236,7 +242,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkVirtualAppliance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -286,11 +292,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualAppliance" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + # type: (...) -> "_models.NetworkVirtualAppliance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,10 +350,10 @@ def begin_create_or_update( self, resource_group_name, # type: str network_virtual_appliance_name, # type: str - parameters, # type: "models.NetworkVirtualAppliance" + parameters, # type: "_models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] + # type: (...) -> LROPoller["_models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -392,7 +398,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -411,7 +423,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Lists all Network Virtual Appliances in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] """Gets all Network Virtual Appliances in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py index 67e1024e8d22c..3f668e364f8b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NetworkWatchersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkWatcher" + parameters, # type: "_models.NetworkWatcher" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Creates or updates a network watcher in the specified resource group. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -125,7 +125,7 @@ def get( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Gets the specified network watcher by resource group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -217,7 +217,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -270,7 +270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -288,10 +294,10 @@ def update_tags( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.NetworkWatcher" + # type: (...) -> "_models.NetworkWatcher" """Updates a network watcher tags. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkWatcher :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +347,7 @@ def update_tags( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -357,7 +363,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by resource group. :param resource_group_name: The name of the resource group. @@ -367,7 +373,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +419,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,7 +434,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkWatcherListResult"] + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] """Gets all network watchers by subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -436,7 +442,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkWatcherListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +487,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -496,10 +502,10 @@ def get_topology( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TopologyParameters" + parameters, # type: "_models.TopologyParameters" **kwargs # type: Any ): - # type: (...) -> "models.Topology" + # type: (...) -> "_models.Topology" """Gets the current network topology by resource group. :param resource_group_name: The name of the resource group. @@ -513,7 +519,7 @@ def get_topology( :rtype: ~azure.mgmt.network.v2020_06_01.models.Topology :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +555,7 @@ def get_topology( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Topology', pipeline_response) @@ -564,11 +570,11 @@ def _verify_ip_flow_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> "models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +610,7 @@ def _verify_ip_flow_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -623,10 +629,10 @@ def begin_verify_ip_flow( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.VerificationIPFlowParameters" + parameters, # type: "_models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VerificationIPFlowResult"] + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] """Verify IP flow from the specified VM to a location given the currently configured NSG rules. :param resource_group_name: The name of the resource group. @@ -646,7 +652,7 @@ def begin_verify_ip_flow( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VerificationIPFlowResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -671,7 +677,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -689,11 +701,11 @@ def _get_next_hop_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> "models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,7 +741,7 @@ def _get_next_hop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -748,10 +760,10 @@ def begin_get_next_hop( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NextHopParameters" + parameters, # type: "_models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NextHopResult"] + # type: (...) -> LROPoller["_models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -771,7 +783,7 @@ def begin_get_next_hop( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NextHopResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -796,7 +808,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -814,11 +832,11 @@ def _get_vm_security_rules_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> "models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -854,7 +872,7 @@ def _get_vm_security_rules_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -873,10 +891,10 @@ def begin_get_vm_security_rules( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.SecurityGroupViewParameters" + parameters, # type: "_models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityGroupViewResult"] + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] """Gets the configured and effective security group rules on the specified VM. :param resource_group_name: The name of the resource group. @@ -896,7 +914,7 @@ def begin_get_vm_security_rules( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityGroupViewResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -921,7 +939,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -939,11 +963,11 @@ def _get_troubleshooting_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -979,7 +1003,7 @@ def _get_troubleshooting_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -998,10 +1022,10 @@ def begin_get_troubleshooting( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.TroubleshootingParameters" + parameters, # type: "_models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,7 +1045,7 @@ def begin_get_troubleshooting( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1046,7 +1070,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1064,11 +1094,11 @@ def _get_troubleshooting_result_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> "models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1104,7 +1134,7 @@ def _get_troubleshooting_result_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1123,10 +1153,10 @@ def begin_get_troubleshooting_result( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.QueryTroubleshootingParameters" + parameters, # type: "_models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.TroubleshootingResult"] + # type: (...) -> LROPoller["_models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1146,7 +1176,7 @@ def begin_get_troubleshooting_result( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.TroubleshootingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1171,7 +1201,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1189,11 +1225,11 @@ def _set_flow_log_configuration_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1229,7 +1265,7 @@ def _set_flow_log_configuration_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1248,10 +1284,10 @@ def begin_set_flow_log_configuration( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogInformation" + parameters, # type: "_models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Configures flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1271,7 +1307,7 @@ def begin_set_flow_log_configuration( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1296,7 +1332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1314,11 +1356,11 @@ def _get_flow_log_status_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> "models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1354,7 +1396,7 @@ def _get_flow_log_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1373,10 +1415,10 @@ def begin_get_flow_log_status( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.FlowLogStatusParameters" + parameters, # type: "_models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.FlowLogInformation"] + # type: (...) -> LROPoller["_models.FlowLogInformation"] """Queries status of flow log and traffic analytics (optional) on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1397,7 +1439,7 @@ def begin_get_flow_log_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1422,7 +1464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1440,11 +1488,11 @@ def _check_connectivity_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1480,7 +1528,7 @@ def _check_connectivity_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1499,10 +1547,10 @@ def begin_check_connectivity( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.ConnectivityParameters" + parameters, # type: "_models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectivityInformation"] + # type: (...) -> LROPoller["_models.ConnectivityInformation"] """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1523,7 +1571,7 @@ def begin_check_connectivity( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectivityInformation"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1548,7 +1596,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1566,11 +1620,11 @@ def _get_azure_reachability_report_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> "models.AzureReachabilityReport" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1606,7 +1660,7 @@ def _get_azure_reachability_report_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1625,10 +1679,10 @@ def begin_get_azure_reachability_report( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AzureReachabilityReportParameters" + parameters, # type: "_models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AzureReachabilityReport"] + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] """NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1650,7 +1704,7 @@ def begin_get_azure_reachability_report( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureReachabilityReport"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1675,7 +1729,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1693,11 +1753,11 @@ def _list_available_providers_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> "models.AvailableProvidersList" - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1733,7 +1793,7 @@ def _list_available_providers_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1752,10 +1812,10 @@ def begin_list_available_providers( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.AvailableProvidersListParameters" + parameters, # type: "_models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AvailableProvidersList"] + # type: (...) -> LROPoller["_models.AvailableProvidersList"] """NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. @@ -1776,7 +1836,7 @@ def begin_list_available_providers( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableProvidersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1801,7 +1861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1819,11 +1885,11 @@ def _get_network_configuration_diagnostic_initial( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> "models.NetworkConfigurationDiagnosticResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1859,7 +1925,7 @@ def _get_network_configuration_diagnostic_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -1878,10 +1944,10 @@ def begin_get_network_configuration_diagnostic( self, resource_group_name, # type: str network_watcher_name, # type: str - parameters, # type: "models.NetworkConfigurationDiagnosticParameters" + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] """Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow @@ -1905,7 +1971,7 @@ def begin_get_network_configuration_diagnostic( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkConfigurationDiagnosticResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1930,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py index 3ffc7cd3c079b..89933d6b97b78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Network Rest API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_p2_svpn_gateways_operations.py index cd5f6fef29ec8..c0f0a4f544f92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_p2_svpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_p2_svpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class P2SVpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" + # type: (...) -> "_models.P2SVpnGateway" """Retrieves the details of a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.P2SVpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,11 +241,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,10 +297,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -315,7 +321,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +346,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,7 +481,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListP2SVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] """Lists all the P2SVpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -541,7 +559,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListP2SVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -602,8 +620,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -652,7 +670,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Resets the primary of the p2s vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -670,7 +688,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -694,7 +712,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -712,11 +736,11 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnProfileResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -768,10 +792,10 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str gateway_name, # type: str - parameters, # type: "models.P2SVpnProfileParameters" + parameters, # type: "_models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnProfileResponse"] + # type: (...) -> LROPoller["_models.VpnProfileResponse"] """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -792,7 +816,7 @@ def begin_generate_vpn_profile( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -837,8 +867,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -887,7 +917,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnGateway"] + # type: (...) -> LROPoller["_models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -906,7 +936,7 @@ def begin_get_p2_s_vpn_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -930,7 +960,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -948,11 +984,11 @@ def _get_p2_s_vpn_connection_health_detailed_initial( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.P2SVpnConnectionHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,10 +1040,10 @@ def begin_get_p2_s_vpn_connection_health_detailed( self, resource_group_name, # type: str gateway_name, # type: str - request, # type: "models.P2SVpnConnectionHealthRequest" + request, # type: "_models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.P2SVpnConnectionHealth"] + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] """Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -1028,7 +1064,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1053,7 +1089,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1071,7 +1113,7 @@ def _disconnect_p2_s_vpn_connections_initial( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -1122,7 +1164,7 @@ def begin_disconnect_p2_s_vpn_connections( self, resource_group_name, # type: str p2_s_vpn_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1168,7 +1210,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py index 279044ec0017d..30fce13da4936 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PacketCapturesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_initial( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def _create_initial( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -109,10 +109,10 @@ def begin_create( resource_group_name, # type: str network_watcher_name, # type: str packet_capture_name, # type: str - parameters, # type: "models.PacketCapture" + parameters, # type: "_models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureResult"] + # type: (...) -> LROPoller["_models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -181,7 +188,7 @@ def get( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureResult" + # type: (...) -> "_models.PacketCaptureResult" """Gets a packet capture session by name. :param resource_group_name: The name of the resource group. @@ -195,7 +202,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PacketCaptureResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PacketCaptureResult', pipeline_response) @@ -278,7 +285,7 @@ def _delete_initial( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -389,7 +403,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -446,7 +460,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -467,8 +488,8 @@ def _get_status_initial( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +521,7 @@ def _get_status_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -522,7 +543,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -542,7 +563,7 @@ def begin_get_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureQueryStatusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,7 +588,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -587,7 +615,7 @@ def list( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PacketCaptureListResult"] + # type: (...) -> Iterable["_models.PacketCaptureListResult"] """Lists all packet capture sessions within the specified resource group. :param resource_group_name: The name of the resource group. @@ -599,7 +627,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PacketCaptureListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +674,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_peer_express_route_circuit_connections_operations.py index 584a30bfa6718..d511f81f9659d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_peer_express_route_circuit_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_peer_express_route_circuit_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PeerExpressRouteCircuitConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PeerExpressRouteCircuitConnection" + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" """Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. @@ -70,7 +70,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PeerExpressRouteCircuitConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ def list( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PeerExpressRouteCircuitConnectionListResult"] + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] """Gets all global reach peer connections associated with a private peering in an express route circuit. @@ -135,7 +135,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PeerExpressRouteCircuitConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_dns_zone_groups_operations.py index 3ad1e5b0dd01c..c1b55695da648 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_dns_zone_groups_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_dns_zone_groups_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateDnsZoneGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( private_dns_zone_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" + # type: (...) -> "_models.PrivateDnsZoneGroup" """Gets the private dns zone group resource by specified private dns zone group name. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateDnsZoneGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> "models.PrivateDnsZoneGroup" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + # type: (...) -> "_models.PrivateDnsZoneGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str private_endpoint_name, # type: str private_dns_zone_group_name, # type: str - parameters, # type: "models.PrivateDnsZoneGroup" + parameters, # type: "_models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateDnsZoneGroup"] + # type: (...) -> LROPoller["_models.PrivateDnsZoneGroup"] """Creates or updates a private dns zone group in the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateDnsZoneGroupListResult"] + # type: (...) -> Iterable["_models.PrivateDnsZoneGroupListResult"] """Gets all private dns zone groups in a private endpoint. :param private_endpoint_name: The name of the private endpoint. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateDnsZoneGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +430,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py index 9c56fd94826cd..b36b1f06d1d53 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" + # type: (...) -> "_models.PrivateEndpoint" """Gets the specified private endpoint by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpoint', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str private_endpoint_name, # type: str - parameters, # type: "models.PrivateEndpoint" + parameters, # type: "_models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpoint"] + # type: (...) -> LROPoller["_models.PrivateEndpoint"] """Creates or updates an private endpoint in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] """Gets all private endpoints in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_link_services_operations.py index 9abcfd76e0711..b617817111dc1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_link_services_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_link_services_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkServicesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" + # type: (...) -> "_models.PrivateLinkService" """Gets the specified private link service by resource group. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateLinkService :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkService', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkService" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_name, # type: str - parameters, # type: "models.PrivateLinkService" + parameters, # type: "_models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkService"] + # type: (...) -> LROPoller["_models.PrivateLinkService"] """Creates or updates an private link service in the specified resource group. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link services in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkServiceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] """Gets all private link service in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateLinkServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -490,7 +502,7 @@ def get_private_endpoint_connection( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Get the specific private end point connection by specific private link service in the resource group. @@ -507,7 +519,7 @@ def get_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +553,7 @@ def get_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -557,10 +569,10 @@ def update_private_endpoint_connection( resource_group_name, # type: str service_name, # type: str pe_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Approve or reject private end point connection for a private link service in a subscription. :param resource_group_name: The name of the resource group. @@ -576,7 +588,7 @@ def update_private_endpoint_connection( :rtype: ~azure.mgmt.network.v2020_06_01.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def update_private_endpoint_connection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -664,7 +676,7 @@ def _delete_private_endpoint_connection_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -721,7 +733,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -741,7 +760,7 @@ def list_private_endpoint_connections( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private end point connections for a specific private link service. :param resource_group_name: The name of the resource group. @@ -753,7 +772,7 @@ def list_private_endpoint_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +819,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -814,11 +833,11 @@ def get_next(next_link=None): def _check_private_link_service_visibility_initial( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -868,10 +887,10 @@ def _check_private_link_service_visibility_initial( def begin_check_private_link_service_visibility( self, location, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service. :param location: The location of the domain name. @@ -889,7 +908,7 @@ def begin_check_private_link_service_visibility( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,7 +932,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -931,11 +955,11 @@ def _check_private_link_service_visibility_by_resource_group_initial( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -987,10 +1011,10 @@ def begin_check_private_link_service_visibility_by_resource_group( self, location, # type: str resource_group_name, # type: str - parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] """Checks whether the subscription is visible to private link service in the specified resource group. @@ -1011,7 +1035,7 @@ def begin_check_private_link_service_visibility_by_resource_group( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1036,7 +1060,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1055,7 +1085,7 @@ def list_auto_approved_private_link_services( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1066,7 +1096,7 @@ def list_auto_approved_private_link_services( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1128,7 +1158,7 @@ def list_auto_approved_private_link_services_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoApprovedPrivateLinkServicesResult"] + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] """Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. @@ -1141,7 +1171,7 @@ def list_auto_approved_private_link_services_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.AutoApprovedPrivateLinkServicesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_addresses_operations.py index 16f509ebf49cd..69b359334e366 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_addresses_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_addresses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPAddressesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Gets the specified public IP address in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.PublicIPAddress" + parameters, # type: "_models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPAddress"] + # type: (...) -> LROPoller["_models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_address_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all the public IP addresses in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets all public IP addresses in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -550,7 +562,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( virtual_machine_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses on a virtual machine scale set level. :param resource_group_name: The name of the resource group. @@ -562,7 +574,7 @@ def list_virtual_machine_scale_set_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -628,7 +640,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( ip_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPAddressListResult"] + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] """Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set. @@ -647,7 +659,7 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPAddressListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +730,7 @@ def get_virtual_machine_scale_set_public_ip_address( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPAddress" + # type: (...) -> "_models.PublicIPAddress" """Get the specified public IP address in a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -740,7 +752,7 @@ def get_virtual_machine_scale_set_public_ip_address( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_prefixes_operations.py index ddf424d98f733..a9a0bf5bc1725 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_prefixes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_prefixes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PublicIPPrefixesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Gets the specified public IP prefix in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.PublicIPPrefix" + parameters, # type: "_models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PublicIPPrefix"] + # type: (...) -> LROPoller["_models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str public_ip_prefix_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.PublicIPPrefix" + # type: (...) -> "_models.PublicIPPrefix" """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.PublicIPPrefix :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all the public IP prefixes in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PublicIPPrefixListResult"] + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] """Gets all public IP prefixes in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.PublicIPPrefixListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py index e3cd8eecf986e..a47c17be89b49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ResourceNavigationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceNavigationLinksListResult" + # type: (...) -> "_models.ResourceNavigationLinksListResult" """Gets a list of resource navigation links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ResourceNavigationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filter_rules_operations.py index e12b246780b2d..6b8eaae1bd298 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filter_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filter_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFilterRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" + # type: (...) -> "_models.RouteFilterRule" """Gets the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_filter_name, # type: str rule_name, # type: str - route_filter_rule_parameters, # type: "models.RouteFilterRule" + route_filter_rule_parameters, # type: "_models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilterRule"] + # type: (...) -> LROPoller["_models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list_by_route_filter( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterRuleListResult"] + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] """Gets all RouteFilterRules in a route filter. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_route_filter( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py index 4009cb08932eb..ac93169598bf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteFiltersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Gets the specified route filter. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_filter_name, # type: str - route_filter_parameters, # type: "models.RouteFilter" + route_filter_parameters, # type: "_models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteFilter"] + # type: (...) -> LROPoller["_models.RouteFilter"] """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str route_filter_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteFilter" + # type: (...) -> "_models.RouteFilter" """Updates tags of a route filter. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -412,7 +424,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a resource group. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -482,7 +494,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteFilterListResult"] + # type: (...) -> Iterable["_models.RouteFilterListResult"] """Gets all route filters in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -490,7 +502,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteFilterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py index ed7d1aa9714c4..7803bb7df79ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RouteTablesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Gets the specified route table. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.RouteTable" + parameters, # type: "_models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RouteTable"] + # type: (...) -> LROPoller["_models.RouteTable"] """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str route_table_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.RouteTable" + # type: (...) -> "_models.RouteTable" """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.RouteTable :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a resource group. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +493,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteTableListResult"] + # type: (...) -> Iterable["_models.RouteTableListResult"] """Gets all route tables in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -489,7 +501,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteTableListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_operations.py index a14d5f7994568..7ee885851b5ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class RoutesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Route" + # type: (...) -> "_models.Route" """Gets the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.Route :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> "models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str route_table_name, # type: str route_name, # type: str - route_parameters, # type: "models.Route" + route_parameters, # type: "_models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Route"] + # type: (...) -> LROPoller["_models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -310,7 +317,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def list( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RouteListResult"] + # type: (...) -> Iterable["_models.RouteListResult"] """Gets all routes in a route table. :param resource_group_name: The name of the resource group. @@ -368,7 +382,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.RouteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_partner_providers_operations.py index 0ea463f906340..92c278da2416e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_partner_providers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_partner_providers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityPartnerProvidersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( security_partner_provider_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Gets the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + # type: (...) -> "_models.SecurityPartnerProvider" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.SecurityPartnerProvider" + parameters, # type: "_models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityPartnerProvider"] + # type: (...) -> LROPoller["_models.SecurityPartnerProvider"] """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -321,7 +327,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -339,10 +351,10 @@ def update_tags( self, resource_group_name, # type: str security_partner_provider_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.SecurityPartnerProvider" + # type: (...) -> "_models.SecurityPartnerProvider" """Updates tags of a Security Partner Provider resource. :param resource_group_name: The name of the resource group. @@ -356,7 +368,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProvider :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -407,7 +419,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Lists all Security Partner Providers in a resource group. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -477,7 +489,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityPartnerProviderListResult"] + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] """Gets all the Security Partner Providers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -485,7 +497,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityPartnerProviderListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py index ecd45875c22e9..d96bd519c3311 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SecurityRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" + # type: (...) -> "_models.SecurityRule" """Get the specified network security rule. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.SecurityRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> "models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_security_group_name, # type: str security_rule_name, # type: str - security_rule_parameters, # type: "models.SecurityRule" + security_rule_parameters, # type: "_models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SecurityRule"] + # type: (...) -> LROPoller["_models.SecurityRule"] """Creates or updates a security rule in the specified network security group. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SecurityRuleListResult"] + # type: (...) -> Iterable["_models.SecurityRuleListResult"] """Gets all security rules in a network security group. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.SecurityRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_association_links_operations.py index 5c069f93d461a..cac3cbec66bea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_association_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_association_links_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceAssociationLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceAssociationLinksListResult" + # type: (...) -> "_models.ServiceAssociationLinksListResult" """Gets a list of service association links for a subnet. :param resource_group_name: The name of the resource group. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceAssociationLinksListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policies_operations.py index f826d941fd43c..eed72586f0f17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Gets the specified service Endpoint Policies in a specified resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.ServiceEndpointPolicy" + parameters, # type: "_models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -301,7 +307,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,7 +332,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -344,10 +356,10 @@ def update_tags( self, resource_group_name, # type: str service_endpoint_policy_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicy" + # type: (...) -> "_models.ServiceEndpointPolicy" """Updates tags of a service endpoint policy. :param resource_group_name: The name of the resource group. @@ -361,7 +373,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all the service endpoint policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -419,7 +431,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -479,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] """Gets all service endpoint Policies in a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policy_definitions_operations.py index bd532c9d51a41..4cd2bc81230e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policy_definitions_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policy_definitions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ServiceEndpointPolicyDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" """Get the specified service endpoint policy definitions from service endpoint policy. :param resource_group_name: The name of the resource group. @@ -180,7 +187,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> "models.ServiceEndpointPolicyDefinition" - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,10 +294,10 @@ def begin_create_or_update( resource_group_name, # type: str service_endpoint_policy_name, # type: str service_endpoint_policy_definition_name, # type: str - service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list_by_resource_group( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ServiceEndpointPolicyDefinitionListResult"] + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] """Gets all service endpoint policy definitions in a service end point policy. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicyDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py index 43e61524d4f35..55a7cb8c4392d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceTagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceTagsListResult" + # type: (...) -> "_models.ServiceTagsListResult" """Gets a list of service tag information resources. :param location: The location that will be used as a reference for version (not as a filter @@ -61,7 +61,7 @@ def list( :rtype: ~azure.mgmt.network.v2020_06_01.models.ServiceTagsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py index 94230cbe358be..fa74cb2df593a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SubnetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Subnet" + # type: (...) -> "_models.Subnet" """Gets the specified subnet by virtual network and resource group. :param resource_group_name: The name of the resource group. @@ -181,7 +188,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.Subnet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,11 +237,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> "models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -290,10 +297,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - subnet_parameters, # type: "models.Subnet" + subnet_parameters, # type: "_models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Subnet"] + # type: (...) -> LROPoller["_models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -315,7 +322,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def _prepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +427,7 @@ def begin_prepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -481,7 +502,7 @@ def _unprepare_network_policies_initial( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> None @@ -534,7 +555,7 @@ def begin_unprepare_network_policies( resource_group_name, # type: str virtual_network_name, # type: str subnet_name, # type: str - unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -583,7 +604,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -603,7 +631,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SubnetListResult"] + # type: (...) -> Iterable["_models.SubnetListResult"] """Gets all subnets in a virtual network. :param resource_group_name: The name of the resource group. @@ -615,7 +643,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.SubnetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py index f777fe2ca8093..04918e2dad62b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsagesListResult"] + # type: (...) -> Iterable["_models.UsagesListResult"] """List network usages for a subscription. :param location: The location where resource usage is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.UsagesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_sites_operations.py index 40f6a48b8f883..947b5df125745 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualApplianceSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualApplianceSite" + # type: (...) -> "_models.VirtualApplianceSite" """Gets the specified Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualApplianceSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str network_virtual_appliance_name, # type: str site_name, # type: str - parameters, # type: "models.VirtualApplianceSite" + parameters, # type: "_models.VirtualApplianceSite" **kwargs # type: Any ): - # type: (...) -> "models.VirtualApplianceSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + # type: (...) -> "_models.VirtualApplianceSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str network_virtual_appliance_name, # type: str site_name, # type: str - parameters, # type: "models.VirtualApplianceSite" + parameters, # type: "_models.VirtualApplianceSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualApplianceSite"] + # type: (...) -> LROPoller["_models.VirtualApplianceSite"] """Creates or updates the specified Network Virtual Appliance Site. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( network_virtual_appliance_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceSiteListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceSiteListResult"] """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceSiteListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSiteListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_skus_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_skus_operations.py index d198fb4cd186f..f9065218b7e81 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_skus_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualApplianceSkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkVirtualApplianceSkuListResult"] + # type: (...) -> Iterable["_models.NetworkVirtualApplianceSkuListResult"] """List all SKUs available for a virtual appliance. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceSkuListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSkuListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def get( sku_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkVirtualApplianceSku" + # type: (...) -> "_models.NetworkVirtualApplianceSku" """Retrieves a single available sku for network virtual appliance. :param sku_name: Name of the Sku. @@ -127,7 +127,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.NetworkVirtualApplianceSku :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connection_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connection_operations.py index 4cab60daf7bf1..274ef0fcde6b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connection_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connection_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualHubBgpConnectionOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BgpConnection" + # type: (...) -> "_models.BgpConnection" """Retrieves the details of a Virtual Hub Bgp Connection. :param resource_group_name: The resource group name of the VirtualHub. @@ -67,7 +67,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.BgpConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,11 +114,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - parameters, # type: "models.BgpConnection" + parameters, # type: "_models.BgpConnection" **kwargs # type: Any ): - # type: (...) -> "models.BgpConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + # type: (...) -> "_models.BgpConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,10 +174,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str connection_name, # type: str - parameters, # type: "models.BgpConnection" + parameters, # type: "_models.BgpConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpConnection"] + # type: (...) -> LROPoller["_models.BgpConnection"] """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. @@ -200,7 +200,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -226,7 +226,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -336,7 +343,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connections_operations.py index 5935fbb19f95b..763527309f425 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubBgpConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubBgpConnectionResults"] + # type: (...) -> Iterable["_models.ListVirtualHubBgpConnectionResults"] """Retrieves the details of all VirtualHubBgpConnections. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubBgpConnectionResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubBgpConnectionResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -129,8 +129,8 @@ def _list_learned_routes_initial( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.PeerRouteList"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PeerRouteList"]] + # type: (...) -> Optional["_models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ def begin_list_learned_routes( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PeerRouteList"] + # type: (...) -> LROPoller["_models.PeerRouteList"] """Retrieves a list of routes the virtual hub bgp connection has learned. :param resource_group_name: The name of the resource group. @@ -201,7 +201,7 @@ def begin_list_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -226,7 +226,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -247,8 +254,8 @@ def _list_advertised_routes_initial( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.PeerRouteList"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PeerRouteList"]] + # type: (...) -> Optional["_models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,7 +306,7 @@ def begin_list_advertised_routes( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PeerRouteList"] + # type: (...) -> LROPoller["_models.PeerRouteList"] """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. :param resource_group_name: The name of the resource group. @@ -319,7 +326,7 @@ def begin_list_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +351,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_ip_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_ip_configuration_operations.py index dc9bdb66436e1..9f17c6e87a82b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_ip_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_ip_configuration_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubIpConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( ip_config_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.HubIpConfiguration" + # type: (...) -> "_models.HubIpConfiguration" """Retrieves the details of a Virtual Hub Ip configuration. :param resource_group_name: The resource group name of the VirtualHub. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.HubIpConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str ip_config_name, # type: str - parameters, # type: "models.HubIpConfiguration" + parameters, # type: "_models.HubIpConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.HubIpConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + # type: (...) -> "_models.HubIpConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str ip_config_name, # type: str - parameters, # type: "models.HubIpConfiguration" + parameters, # type: "_models.HubIpConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.HubIpConfiguration"] + # type: (...) -> LROPoller["_models.HubIpConfiguration"] """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubIpConfigurationResults"] + # type: (...) -> Iterable["_models.ListVirtualHubIpConfigurationResults"] """Retrieves the details of all VirtualHubIpConfigurations. :param resource_group_name: The resource group name of the VirtualHub. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubIpConfigurationResults] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubIpConfigurationResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_route_table_v2_s_operations.py index a66b8e7989f64..a19382bb83878 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_route_table_v2_s_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubRouteTableV2SOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" + # type: (...) -> "_models.VirtualHubRouteTableV2" """Retrieves the details of a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualHubRouteTableV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) @@ -116,11 +116,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHubRouteTableV2" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,10 +177,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_hub_name, # type: str route_table_name, # type: str - virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -204,7 +204,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -230,7 +230,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -284,7 +291,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -341,7 +348,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,7 +375,7 @@ def list( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubRouteTableV2SResult"] + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] """Retrieves the details of all VirtualHubRouteTableV2s. :param resource_group_name: The resource group name of the VirtualHub. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubRouteTableV2SResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py index e393b19d3fe8b..9dd1b6d9ddb99 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Retrieves the details of a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.VirtualHub" + virtual_hub_parameters, # type: "_models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualHub"] + # type: (...) -> LROPoller["_models.VirtualHub"] """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_hub_name, # type: str - virtual_hub_parameters, # type: "models.TagsObject" + virtual_hub_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualHub" + # type: (...) -> "_models.VirtualHub" """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualHub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a resource group. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualHubsResult"] + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] """Lists all the VirtualHubs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualHubsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +555,7 @@ def _get_effective_virtual_hub_routes_initial( self, resource_group_name, # type: str virtual_hub_name, # type: str - effective_routes_parameters=None, # type: Optional["models.EffectiveRoutesParameters"] + effective_routes_parameters=None, # type: Optional["_models.EffectiveRoutesParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -597,7 +609,7 @@ def begin_get_effective_virtual_hub_routes( self, resource_group_name, # type: str virtual_hub_name, # type: str - effective_routes_parameters=None, # type: Optional["models.EffectiveRoutesParameters"] + effective_routes_parameters=None, # type: Optional["_models.EffectiveRoutesParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -643,7 +655,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateway_connections_operations.py index cf1aa456c180c..6ba724e241c69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateway_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateway_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VirtualNetworkGatewayConnection" + parameters, # type: "_models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Creates or updates a virtual network gateway connection in the specified resource group. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -179,7 +185,7 @@ def get( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" + # type: (...) -> "_models.VirtualNetworkGatewayConnection" """Gets the specified virtual network gateway connection by resource group. :param resource_group_name: The name of the resource group. @@ -192,7 +198,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -342,11 +354,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -398,10 +410,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -422,7 +434,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -447,7 +459,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -465,11 +483,11 @@ def _set_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,10 +541,10 @@ def begin_set_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionSharedKey" + parameters, # type: "_models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -549,7 +567,7 @@ def begin_set_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -574,7 +592,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +618,7 @@ def get_shared_key( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConnectionSharedKey" + # type: (...) -> "_models.ConnectionSharedKey" """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. @@ -608,7 +632,7 @@ def get_shared_key( :rtype: ~azure.mgmt.network.v2020_06_01.models.ConnectionSharedKey :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,7 +678,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayConnectionListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,11 +749,11 @@ def _reset_shared_key_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> Optional["models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -781,10 +805,10 @@ def begin_reset_shared_key( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.ConnectionResetSharedKey" + parameters, # type: "_models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ConnectionResetSharedKey"] + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @@ -808,7 +832,7 @@ def begin_reset_shared_key( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -833,7 +857,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -851,7 +881,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -894,7 +924,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -911,7 +941,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -961,7 +991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -979,7 +1015,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1019,7 +1055,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1036,7 +1072,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1086,7 +1122,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateways_operations.py index 3014f3eb69e1c..620f70fc62908 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VirtualNetworkGateway" + parameters, # type: "_models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Creates or updates a virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -177,7 +183,7 @@ def get( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" + # type: (...) -> "_models.VirtualNetworkGateway" """Gets the specified virtual network gateway by resource group. :param resource_group_name: The name of the resource group. @@ -189,7 +195,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,11 +350,11 @@ def _update_tags_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,10 +406,10 @@ def begin_update_tags( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -417,7 +429,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -442,7 +454,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -461,7 +479,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] """Gets all virtual network gateways by resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ def list_connections( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkGatewayListConnectionsResult"] + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] """Gets all the connections in a virtual network gateway. :param resource_group_name: The name of the resource group. @@ -545,7 +563,7 @@ def list_connections( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGatewayListConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,8 +627,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +680,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkGateway"] + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] """Resets the primary of the virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -813,7 +837,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +861,7 @@ def _generatevpnclientpackage_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -887,7 +917,7 @@ def begin_generatevpnclientpackage( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -937,7 +967,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -955,7 +991,7 @@ def _generate_vpn_profile_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1011,7 +1047,7 @@ def begin_generate_vpn_profile( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnClientParameters" + parameters, # type: "_models.VpnClientParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -1061,7 +1097,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1174,7 +1216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1195,8 +1243,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,7 +1296,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1268,7 +1316,7 @@ def begin_get_bgp_peer_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1372,8 +1426,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1476,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1441,7 +1495,7 @@ def begin_get_learned_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1465,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1486,8 +1546,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1538,7 +1598,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GatewayRouteListResult"] + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1559,7 +1619,7 @@ def begin_get_advertised_routes( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1584,7 +1644,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1602,11 +1668,11 @@ def _set_vpnclient_ipsec_parameters_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientIPsecParameters"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1658,10 +1724,10 @@ def begin_set_vpnclient_ipsec_parameters( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1683,7 +1749,7 @@ def begin_set_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1708,7 +1774,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1728,8 +1800,8 @@ def _get_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1776,7 +1848,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientIPsecParameters"] + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider. @@ -1796,7 +1868,7 @@ def begin_get_vpnclient_ipsec_parameters( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1820,7 +1892,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1838,7 +1916,7 @@ def vpn_device_configuration_script( self, resource_group_name, # type: str virtual_network_gateway_connection_name, # type: str - parameters, # type: "models.VpnDeviceScriptParameters" + parameters, # type: "_models.VpnDeviceScriptParameters" **kwargs # type: Any ): # type: (...) -> str @@ -1906,7 +1984,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -1949,7 +2027,7 @@ def _start_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1966,7 +2044,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2015,7 +2093,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2033,7 +2117,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -2073,7 +2157,7 @@ def _stop_packet_capture_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -2090,7 +2174,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - parameters, # type: "models.VpnPacketCaptureStopParameters" + parameters, # type: "_models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -2139,7 +2223,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2159,8 +2249,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2209,7 +2299,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2228,7 +2318,7 @@ def begin_get_vpnclient_connection_health( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2252,7 +2342,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2270,7 +2366,7 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> None @@ -2321,7 +2417,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( self, resource_group_name, # type: str virtual_network_gateway_name, # type: str - request, # type: "models.P2SVpnConnectionRequest" + request, # type: "_models.P2SVpnConnectionRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2366,7 +2462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_peerings_operations.py index 3ba01285b9a01..c20bb24a8b9c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -143,7 +143,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -164,7 +171,7 @@ def get( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" + # type: (...) -> "_models.VirtualNetworkPeering" """Gets the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -178,7 +185,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,11 +232,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,10 +292,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_network_name, # type: str virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkPeering"] + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -311,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -357,7 +371,7 @@ def list( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] """Gets all virtual network peerings in a virtual network. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_taps_operations.py index 44c01179dddcb..2b233fba7c9c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_taps_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_taps_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworkTapsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -157,7 +163,7 @@ def get( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Gets information about the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -169,7 +175,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,11 +220,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,10 +278,10 @@ def begin_create_or_update( self, resource_group_name, # type: str tap_name, # type: str - parameters, # type: "models.VirtualNetworkTap" + parameters, # type: "_models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetworkTap"] + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -295,7 +301,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -320,7 +326,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -338,10 +350,10 @@ def update_tags( self, resource_group_name, # type: str tap_name, # type: str - tap_parameters, # type: "models.TagsObject" + tap_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkTap" + # type: (...) -> "_models.VirtualNetworkTap" """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -413,7 +425,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkTapListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] """Gets all the VirtualNetworkTaps in a subscription. :param resource_group_name: The name of the resource group. @@ -483,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkTapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py index a26917b63204e..0659dcf98f1d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualNetworksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -137,7 +137,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -158,7 +164,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Gets the specified virtual network by resource group. :param resource_group_name: The name of the resource group. @@ -172,7 +178,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,11 +225,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -277,10 +283,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.VirtualNetwork" + parameters, # type: "_models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualNetwork"] + # type: (...) -> LROPoller["_models.VirtualNetwork"] """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -300,7 +306,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -325,7 +331,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -343,10 +355,10 @@ def update_tags( self, resource_group_name, # type: str virtual_network_name, # type: str - parameters, # type: "models.TagsObject" + parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetwork" + # type: (...) -> "_models.VirtualNetwork" """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -360,7 +372,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualNetwork :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -410,7 +422,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -418,7 +430,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +490,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] """Gets all virtual networks in a resource group. :param resource_group_name: The name of the resource group. @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -551,7 +563,7 @@ def check_ip_address_availability( ip_address, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IPAddressAvailabilityResult" + # type: (...) -> "_models.IPAddressAvailabilityResult" """Checks whether a private IP address is available for use. :param resource_group_name: The name of the resource group. @@ -565,7 +577,7 @@ def check_ip_address_availability( :rtype: ~azure.mgmt.network.v2020_06_01.models.IPAddressAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -613,7 +625,7 @@ def list_usage( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkListUsageResult"] + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] """Lists usage stats. :param resource_group_name: The name of the resource group. @@ -625,7 +637,7 @@ def list_usage( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualNetworkListUsageResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_router_peerings_operations.py index 4e4940ec209c8..8ceebe751001f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_router_peerings_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_router_peerings_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRouterPeeringsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -144,7 +144,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -165,7 +172,7 @@ def get( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" + # type: (...) -> "_models.VirtualRouterPeering" """Gets the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -179,7 +186,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualRouterPeering :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +218,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) @@ -227,11 +234,11 @@ def _create_or_update_initial( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouterPeering" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -268,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -288,10 +295,10 @@ def begin_create_or_update( resource_group_name, # type: str virtual_router_name, # type: str peering_name, # type: str - parameters, # type: "models.VirtualRouterPeering" + parameters, # type: "_models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouterPeering"] + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -314,7 +321,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -340,7 +347,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -360,7 +374,7 @@ def list( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterPeeringListResult"] + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] """Lists all Virtual Router Peerings in a Virtual Router resource. :param resource_group_name: The name of the resource group. @@ -372,7 +386,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualRouterPeeringListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -419,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py index d84c5fb6ef4a1..ec38279385e3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualRoutersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,7 +165,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" + # type: (...) -> "_models.VirtualRouter" """Gets the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -173,7 +179,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualRouter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualRouter', pipeline_response) @@ -221,11 +227,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> "models.VirtualRouter" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +267,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,10 +286,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_router_name, # type: str - parameters, # type: "models.VirtualRouter" + parameters, # type: "_models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualRouter"] + # type: (...) -> LROPoller["_models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -303,7 +309,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -328,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,7 +359,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Lists all Virtual Routers in a resource group. :param resource_group_name: The name of the resource group. @@ -357,7 +369,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -418,7 +430,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualRouterListResult"] + # type: (...) -> Iterable["_models.VirtualRouterListResult"] """Gets all the Virtual Routers in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -426,7 +438,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.VirtualRouterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -471,7 +483,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py index 869e1c8374c14..907d11d67a2e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualWansOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Retrieves the details of a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.VirtualWAN" + wan_parameters, # type: "_models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualWAN"] + # type: (...) -> LROPoller["_models.VirtualWAN"] """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str virtual_wan_name, # type: str - wan_parameters, # type: "models.TagsObject" + wan_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualWAN" + # type: (...) -> "_models.VirtualWAN" """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWAN :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a resource group. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVirtualWANsResult"] + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] """Lists all the VirtualWANs in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVirtualWANsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py index 4c4dfc5429a2a..bb61e1ae06506 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" + # type: (...) -> "_models.VpnConnection" """Retrieves the details of a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> "models.VpnConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -175,10 +175,10 @@ def begin_create_or_update( resource_group_name, # type: str gateway_name, # type: str connection_name, # type: str - vpn_connection_parameters, # type: "models.VpnConnection" + vpn_connection_parameters, # type: "_models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnConnection"] + # type: (...) -> LROPoller["_models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -356,7 +370,7 @@ def _start_packet_capture_initial( resource_group_name, # type: str gateway_name, # type: str vpn_connection_name, # type: str - parameters=None, # type: Optional["models.VpnConnectionPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -417,7 +431,7 @@ def begin_start_packet_capture( resource_group_name, # type: str gateway_name, # type: str vpn_connection_name, # type: str - parameters=None, # type: Optional["models.VpnConnectionPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -469,7 +483,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -488,7 +509,7 @@ def _stop_packet_capture_initial( resource_group_name, # type: str gateway_name, # type: str vpn_connection_name, # type: str - parameters=None, # type: Optional["models.VpnConnectionPacketCaptureStopParameters"] + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStopParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -549,7 +570,7 @@ def begin_stop_packet_capture( resource_group_name, # type: str gateway_name, # type: str vpn_connection_name, # type: str - parameters=None, # type: Optional["models.VpnConnectionPacketCaptureStopParameters"] + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStopParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -601,7 +622,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -621,7 +649,7 @@ def list_by_vpn_gateway( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] """Retrieves all vpn connections for a particular virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -633,7 +661,7 @@ def list_by_vpn_gateway( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py index 1132286cf6719..5411d4e4f571f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnGatewaysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" + # type: (...) -> "_models.VpnGateway" """Retrieves the details of a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnGateway :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.VpnGateway" + vpn_gateway_parameters, # type: "_models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -192,7 +192,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -235,11 +241,11 @@ def _update_tags_initial( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,10 +297,10 @@ def begin_update_tags( self, resource_group_name, # type: str gateway_name, # type: str - vpn_gateway_parameters, # type: "models.TagsObject" + vpn_gateway_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -314,7 +320,7 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -339,7 +345,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -463,8 +481,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnGateway"] + # type: (...) -> LROPoller["_models.VpnGateway"] """Resets the primary of the vpn gateway in the specified resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -531,7 +549,7 @@ def begin_reset( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -573,7 +597,7 @@ def _start_packet_capture_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters=None, # type: Optional["models.VpnGatewayPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -632,7 +656,7 @@ def begin_start_packet_capture( self, resource_group_name, # type: str gateway_name, # type: str - parameters=None, # type: Optional["models.VpnGatewayPacketCaptureStartParameters"] + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStartParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -681,7 +705,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,7 +729,7 @@ def _stop_packet_capture_initial( self, resource_group_name, # type: str gateway_name, # type: str - parameters=None, # type: Optional["models.VpnGatewayPacketCaptureStopParameters"] + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStopParameters"] **kwargs # type: Any ): # type: (...) -> Optional[str] @@ -758,7 +788,7 @@ def begin_stop_packet_capture( self, resource_group_name, # type: str gateway_name, # type: str - parameters=None, # type: Optional["models.VpnGatewayPacketCaptureStopParameters"] + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStopParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[str] @@ -807,7 +837,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -826,7 +862,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a resource group. :param resource_group_name: The resource group name of the VpnGateway. @@ -836,7 +872,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -896,7 +932,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnGatewaysResult"] + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] """Lists all the VpnGateways in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -904,7 +940,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnGatewaysResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_link_connections_operations.py index bb16412e802e7..94b694ee8620b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_link_connections_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_vpn_connection( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinkConnectionsResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. @@ -67,7 +67,7 @@ def list_by_vpn_connection( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSiteLinkConnectionsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py index 2ea0d476a22b2..68d7f582be7b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfigurationsResponse"] + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. :param resource_group_name: The resource group name. @@ -121,7 +121,7 @@ def begin_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_operations.py index 196b452a9b21b..8e67a30ec0c09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnServerConfigurationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Retrieves the details of a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnServerConfiguration"] + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -194,7 +194,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -219,7 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -237,10 +243,10 @@ def update_tags( self, resource_group_name, # type: str vpn_server_configuration_name, # type: str - vpn_server_configuration_parameters, # type: "models.TagsObject" + vpn_server_configuration_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfiguration" + # type: (...) -> "_models.VpnServerConfiguration" """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -255,7 +261,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnServerConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -410,7 +422,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the vpnServerConfigurations in a resource group. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,7 +432,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +492,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnServerConfigurationsResult"] + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] """Lists all the VpnServerConfigurations in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +500,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnServerConfigurationsResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_link_connections_operations.py index 65e97059519a5..dfa90ab91fed2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_link_connections_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_link_connections_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VpnSiteLinkConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( link_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLinkConnection" + # type: (...) -> "_models.VpnSiteLinkConnection" """Retrieves the details of a vpn site link connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSiteLinkConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_links_operations.py index 265aa7a78b256..089fc80dc1632 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_links_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_links_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VpnSiteLinksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( vpn_site_link_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSiteLink" + # type: (...) -> "_models.VpnSiteLink" """Retrieves the details of a VPN site link. :param resource_group_name: The resource group name of the VpnSite. @@ -66,7 +66,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSiteLink :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def list_by_vpn_site( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSiteLinksResult"] + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] """Lists all the vpnSiteLinks in a resource group for a vpn site. :param resource_group_name: The resource group name of the VpnSite. @@ -126,7 +126,7 @@ def list_by_vpn_site( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSiteLinksResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_configuration_operations.py index 24c1e080eab2d..f289ab4702034 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_configuration_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_configuration_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VpnSitesConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def _download_initial( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def begin_download( self, resource_group_name, # type: str virtual_wan_name, # type: str - request, # type: "models.GetVpnSitesConfigurationRequest" + request, # type: "_models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -147,7 +147,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py index f025ee9e7bb1b..7de6d190161cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VpnSitesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Retrieves the details of a VPN site. :param resource_group_name: The resource group name of the VpnSite. @@ -65,7 +65,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,11 +110,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,10 +168,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.VpnSite" + vpn_site_parameters, # type: "_models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VpnSite"] + # type: (...) -> LROPoller["_models.VpnSite"] """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -191,7 +191,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -216,7 +216,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -234,10 +240,10 @@ def update_tags( self, resource_group_name, # type: str vpn_site_name, # type: str - vpn_site_parameters, # type: "models.TagsObject" + vpn_site_parameters, # type: "_models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VpnSite" + # type: (...) -> "_models.VpnSite" """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -251,7 +257,7 @@ def update_tags( :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnSite :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -387,7 +393,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -406,7 +418,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the vpnSites in a resource group. :param resource_group_name: The resource group name of the VpnSite. @@ -416,7 +428,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +488,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListVpnSitesResult"] + # type: (...) -> Iterable["_models.ListVpnSitesResult"] """Lists all the VpnSites in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -484,7 +496,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.ListVpnSitesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_web_application_firewall_policies_operations.py index d05214e7dd765..40c83f0d2679a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_web_application_firewall_policies_operations.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_web_application_firewall_policies_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class WebApplicationFirewallPoliciesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Lists all of the protection policies within a resource group. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.WebApplicationFirewallPolicyListResult"] + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] """Gets all the WAF policies in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,7 +130,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def get( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Retrieve protection policy with specified name within a resource group. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,10 +248,10 @@ def create_or_update( self, resource_group_name, # type: str policy_name, # type: str - parameters, # type: "models.WebApplicationFirewallPolicy" + parameters, # type: "_models.WebApplicationFirewallPolicy" **kwargs # type: Any ): - # type: (...) -> "models.WebApplicationFirewallPolicy" + # type: (...) -> "_models.WebApplicationFirewallPolicy" """Creates or update policy with specified rule set name within a resource group. :param resource_group_name: The name of the resource group. @@ -265,7 +265,7 @@ def create_or_update( :rtype: ~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/__init__.py new file mode 100644 index 0000000000000..202b38f8e292c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._network_management_client import NetworkManagementClient +__all__ = ['NetworkManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_configuration.py new file mode 100644 index 0000000000000..bc5f270f66ac2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class NetworkManagementClientConfiguration(Configuration): + """Configuration for NetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(NetworkManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-network/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_metadata.json new file mode 100644 index 0000000000000..a81bb5d16051e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_metadata.json @@ -0,0 +1,309 @@ +{ + "chosen_version": "2020-07-01", + "total_api_version_list": ["2018-10-01", "2020-07-01"], + "client": { + "name": "NetworkManagementClient", + "filename": "_network_management_client", + "description": "Network Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "application_gateways": "ApplicationGatewaysOperations", + "application_gateway_private_link_resources": "ApplicationGatewayPrivateLinkResourcesOperations", + "application_gateway_private_endpoint_connections": "ApplicationGatewayPrivateEndpointConnectionsOperations", + "application_security_groups": "ApplicationSecurityGroupsOperations", + "available_delegations": "AvailableDelegationsOperations", + "available_resource_group_delegations": "AvailableResourceGroupDelegationsOperations", + "available_service_aliases": "AvailableServiceAliasesOperations", + "azure_firewalls": "AzureFirewallsOperations", + "azure_firewall_fqdn_tags": "AzureFirewallFqdnTagsOperations", + "web_categories": "WebCategoriesOperations", + "bastion_hosts": "BastionHostsOperations", + "custom_ip_prefixes": "CustomIPPrefixesOperations", + "ddos_custom_policies": "DdosCustomPoliciesOperations", + "ddos_protection_plans": "DdosProtectionPlansOperations", + "dscp_configuration": "DscpConfigurationOperations", + "available_endpoint_services": "AvailableEndpointServicesOperations", + "express_route_circuit_authorizations": "ExpressRouteCircuitAuthorizationsOperations", + "express_route_circuit_peerings": "ExpressRouteCircuitPeeringsOperations", + "express_route_circuit_connections": "ExpressRouteCircuitConnectionsOperations", + "peer_express_route_circuit_connections": "PeerExpressRouteCircuitConnectionsOperations", + "express_route_circuits": "ExpressRouteCircuitsOperations", + "express_route_service_providers": "ExpressRouteServiceProvidersOperations", + "express_route_cross_connections": "ExpressRouteCrossConnectionsOperations", + "express_route_cross_connection_peerings": "ExpressRouteCrossConnectionPeeringsOperations", + "express_route_ports_locations": "ExpressRoutePortsLocationsOperations", + "express_route_ports": "ExpressRoutePortsOperations", + "express_route_links": "ExpressRouteLinksOperations", + "firewall_policies": "FirewallPoliciesOperations", + "firewall_policy_rule_collection_groups": "FirewallPolicyRuleCollectionGroupsOperations", + "ip_allocations": "IpAllocationsOperations", + "ip_groups": "IpGroupsOperations", + "load_balancers": "LoadBalancersOperations", + "load_balancer_backend_address_pools": "LoadBalancerBackendAddressPoolsOperations", + "load_balancer_frontend_ip_configurations": "LoadBalancerFrontendIPConfigurationsOperations", + "inbound_nat_rules": "InboundNatRulesOperations", + "load_balancer_load_balancing_rules": "LoadBalancerLoadBalancingRulesOperations", + "load_balancer_outbound_rules": "LoadBalancerOutboundRulesOperations", + "load_balancer_network_interfaces": "LoadBalancerNetworkInterfacesOperations", + "load_balancer_probes": "LoadBalancerProbesOperations", + "nat_gateways": "NatGatewaysOperations", + "network_interfaces": "NetworkInterfacesOperations", + "network_interface_ip_configurations": "NetworkInterfaceIPConfigurationsOperations", + "network_interface_load_balancers": "NetworkInterfaceLoadBalancersOperations", + "network_interface_tap_configurations": "NetworkInterfaceTapConfigurationsOperations", + "network_profiles": "NetworkProfilesOperations", + "network_security_groups": "NetworkSecurityGroupsOperations", + "security_rules": "SecurityRulesOperations", + "default_security_rules": "DefaultSecurityRulesOperations", + "network_virtual_appliances": "NetworkVirtualAppliancesOperations", + "virtual_appliance_sites": "VirtualApplianceSitesOperations", + "virtual_appliance_skus": "VirtualApplianceSkusOperations", + "inbound_security_rule": "InboundSecurityRuleOperations", + "network_watchers": "NetworkWatchersOperations", + "packet_captures": "PacketCapturesOperations", + "connection_monitors": "ConnectionMonitorsOperations", + "flow_logs": "FlowLogsOperations", + "operations": "Operations", + "private_endpoints": "PrivateEndpointsOperations", + "available_private_endpoint_types": "AvailablePrivateEndpointTypesOperations", + "private_dns_zone_groups": "PrivateDnsZoneGroupsOperations", + "private_link_services": "PrivateLinkServicesOperations", + "public_ip_addresses": "PublicIPAddressesOperations", + "public_ip_prefixes": "PublicIPPrefixesOperations", + "route_filters": "RouteFiltersOperations", + "route_filter_rules": "RouteFilterRulesOperations", + "route_tables": "RouteTablesOperations", + "routes": "RoutesOperations", + "security_partner_providers": "SecurityPartnerProvidersOperations", + "bgp_service_communities": "BgpServiceCommunitiesOperations", + "service_endpoint_policies": "ServiceEndpointPoliciesOperations", + "service_endpoint_policy_definitions": "ServiceEndpointPolicyDefinitionsOperations", + "service_tags": "ServiceTagsOperations", + "usages": "UsagesOperations", + "virtual_networks": "VirtualNetworksOperations", + "subnets": "SubnetsOperations", + "resource_navigation_links": "ResourceNavigationLinksOperations", + "service_association_links": "ServiceAssociationLinksOperations", + "virtual_network_peerings": "VirtualNetworkPeeringsOperations", + "virtual_network_gateways": "VirtualNetworkGatewaysOperations", + "virtual_network_gateway_connections": "VirtualNetworkGatewayConnectionsOperations", + "local_network_gateways": "LocalNetworkGatewaysOperations", + "virtual_network_taps": "VirtualNetworkTapsOperations", + "virtual_routers": "VirtualRoutersOperations", + "virtual_router_peerings": "VirtualRouterPeeringsOperations", + "virtual_wans": "VirtualWansOperations", + "vpn_sites": "VpnSitesOperations", + "vpn_site_links": "VpnSiteLinksOperations", + "vpn_sites_configuration": "VpnSitesConfigurationOperations", + "vpn_server_configurations": "VpnServerConfigurationsOperations", + "virtual_hubs": "VirtualHubsOperations", + "hub_virtual_network_connections": "HubVirtualNetworkConnectionsOperations", + "vpn_gateways": "VpnGatewaysOperations", + "vpn_connections": "VpnConnectionsOperations", + "vpn_site_link_connections": "VpnSiteLinkConnectionsOperations", + "vpn_link_connections": "VpnLinkConnectionsOperations", + "p2_svpn_gateways": "P2SVpnGatewaysOperations", + "vpn_server_configurations_associated_with_virtual_wan": "VpnServerConfigurationsAssociatedWithVirtualWanOperations", + "virtual_hub_route_table_v2_s": "VirtualHubRouteTableV2SOperations", + "express_route_gateways": "ExpressRouteGatewaysOperations", + "express_route_connections": "ExpressRouteConnectionsOperations", + "virtual_hub_bgp_connection": "VirtualHubBgpConnectionOperations", + "virtual_hub_bgp_connections": "VirtualHubBgpConnectionsOperations", + "virtual_hub_ip_configuration": "VirtualHubIpConfigurationOperations", + "hub_route_tables": "HubRouteTablesOperations", + "web_application_firewall_policies": "WebApplicationFirewallPoliciesOperations" + }, + "operation_mixins": { + "_put_bastion_shareable_link_initial" : { + "sync": { + "signature": "def _put_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _put_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e Optional[\"_models.BastionShareableLinkListResult\"]:\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name, bsl_request" + }, + "begin_put_bastion_shareable_link" : { + "sync": { + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def begin_put_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]]:\n", + "doc": "\"\"\"Creates a Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name, bsl_request" + }, + "_delete_bastion_shareable_link_initial" : { + "sync": { + "signature": "def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _delete_bastion_shareable_link_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name, bsl_request" + }, + "begin_delete_bastion_shareable_link" : { + "sync": { + "signature": "def begin_delete_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_delete_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Deletes the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name, bsl_request" + }, + "get_bastion_shareable_link" : { + "sync": { + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n bsl_request, # type: \"_models.BastionShareableLinkListRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def get_bastion_shareable_link(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n bsl_request: \"_models.BastionShareableLinkListRequest\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionShareableLinkListResult\"]:\n", + "doc": "\"\"\"Return the Bastion Shareable Links for all the VMs specified in the request.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param bsl_request: Post request for all the Bastion Shareable Link endpoints.\n:type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name, bsl_request" + }, + "_get_active_sessions_initial" : { + "sync": { + "signature": "def _get_active_sessions_initial(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e Optional[\"_models.BastionActiveSessionListResult\"]:\n", + "doc": "\"\"\"\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name" + }, + "begin_get_active_sessions" : { + "sync": { + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.BastionActiveSessionListResult\"]]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name" + }, + "disconnect_active_sessions" : { + "sync": { + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name, # type: str\n bastion_host_name, # type: str\n session_ids, # type: \"_models.SessionIds\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_07_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def disconnect_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n session_ids: \"_models.SessionIds\",\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.BastionSessionDeleteResult\"]:\n", + "doc": "\"\"\"Returns the list of currently active sessions on the Bastion.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param bastion_host_name: The name of the Bastion Host.\n:type bastion_host_name: str\n:param session_ids: The list of sessionids to disconnect.\n:type session_ids: ~azure.mgmt.network.v2020_07_01.models.SessionIds\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionSessionDeleteResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, bastion_host_name, session_ids" + }, + "check_dns_name_availability" : { + "sync": { + "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", + "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "location, domain_name_label" + }, + "supported_security_providers" : { + "sync": { + "signature": "def supported_security_providers(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def supported_security_providers(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n **kwargs\n) -\u003e \"_models.VirtualWanSecurityProviders\":\n", + "doc": "\"\"\"Gives the supported security providers for the virtual wan.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN for which supported security providers are\n needed.\n:type virtual_wan_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VirtualWanSecurityProviders, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviders\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, virtual_wan_name" + }, + "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { + "sync": { + "signature": "def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e Optional[\"_models.VpnProfileResponse\"]:\n", + "doc": "\"\"\"\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, virtual_wan_name, vpn_client_params" + }, + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { + "sync": { + "signature": "def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name, # type: str\n virtual_wan_name, # type: str\n vpn_client_params, # type: \"_models.VirtualWanVpnProfileParameters\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"_models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.VpnProfileResponse\"]:\n", + "doc": "\"\"\"Generates a unique VPN profile for P2S clients for VirtualWan and associated\nVpnServerConfiguration combination in the specified resource group.\n\n:param resource_group_name: The resource group name.\n:type resource_group_name: str\n:param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is\n needed.\n:type virtual_wan_name: str\n:param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation\n operation.\n:type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "resource_group_name, virtual_wan_name, vpn_client_params" + } + }, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.mgmt.core.polling.arm_polling\": [\"ARMPolling\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.mgmt.core.polling.async_arm_polling\": [\"AsyncARMPolling\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" +} \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_network_management_client.py new file mode 100644 index 0000000000000..913fb289ce084 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/_network_management_client.py @@ -0,0 +1,590 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import NetworkManagementClientConfiguration +from .operations import ApplicationGatewaysOperations +from .operations import ApplicationGatewayPrivateLinkResourcesOperations +from .operations import ApplicationGatewayPrivateEndpointConnectionsOperations +from .operations import ApplicationSecurityGroupsOperations +from .operations import AvailableDelegationsOperations +from .operations import AvailableResourceGroupDelegationsOperations +from .operations import AvailableServiceAliasesOperations +from .operations import AzureFirewallsOperations +from .operations import AzureFirewallFqdnTagsOperations +from .operations import WebCategoriesOperations +from .operations import BastionHostsOperations +from .operations import NetworkManagementClientOperationsMixin +from .operations import CustomIPPrefixesOperations +from .operations import DdosCustomPoliciesOperations +from .operations import DdosProtectionPlansOperations +from .operations import DscpConfigurationOperations +from .operations import AvailableEndpointServicesOperations +from .operations import ExpressRouteCircuitAuthorizationsOperations +from .operations import ExpressRouteCircuitPeeringsOperations +from .operations import ExpressRouteCircuitConnectionsOperations +from .operations import PeerExpressRouteCircuitConnectionsOperations +from .operations import ExpressRouteCircuitsOperations +from .operations import ExpressRouteServiceProvidersOperations +from .operations import ExpressRouteCrossConnectionsOperations +from .operations import ExpressRouteCrossConnectionPeeringsOperations +from .operations import ExpressRoutePortsLocationsOperations +from .operations import ExpressRoutePortsOperations +from .operations import ExpressRouteLinksOperations +from .operations import FirewallPoliciesOperations +from .operations import FirewallPolicyRuleCollectionGroupsOperations +from .operations import IpAllocationsOperations +from .operations import IpGroupsOperations +from .operations import LoadBalancersOperations +from .operations import LoadBalancerBackendAddressPoolsOperations +from .operations import LoadBalancerFrontendIPConfigurationsOperations +from .operations import InboundNatRulesOperations +from .operations import LoadBalancerLoadBalancingRulesOperations +from .operations import LoadBalancerOutboundRulesOperations +from .operations import LoadBalancerNetworkInterfacesOperations +from .operations import LoadBalancerProbesOperations +from .operations import NatGatewaysOperations +from .operations import NetworkInterfacesOperations +from .operations import NetworkInterfaceIPConfigurationsOperations +from .operations import NetworkInterfaceLoadBalancersOperations +from .operations import NetworkInterfaceTapConfigurationsOperations +from .operations import NetworkProfilesOperations +from .operations import NetworkSecurityGroupsOperations +from .operations import SecurityRulesOperations +from .operations import DefaultSecurityRulesOperations +from .operations import NetworkVirtualAppliancesOperations +from .operations import VirtualApplianceSitesOperations +from .operations import VirtualApplianceSkusOperations +from .operations import InboundSecurityRuleOperations +from .operations import NetworkWatchersOperations +from .operations import PacketCapturesOperations +from .operations import ConnectionMonitorsOperations +from .operations import FlowLogsOperations +from .operations import Operations +from .operations import PrivateEndpointsOperations +from .operations import AvailablePrivateEndpointTypesOperations +from .operations import PrivateDnsZoneGroupsOperations +from .operations import PrivateLinkServicesOperations +from .operations import PublicIPAddressesOperations +from .operations import PublicIPPrefixesOperations +from .operations import RouteFiltersOperations +from .operations import RouteFilterRulesOperations +from .operations import RouteTablesOperations +from .operations import RoutesOperations +from .operations import SecurityPartnerProvidersOperations +from .operations import BgpServiceCommunitiesOperations +from .operations import ServiceEndpointPoliciesOperations +from .operations import ServiceEndpointPolicyDefinitionsOperations +from .operations import ServiceTagsOperations +from .operations import UsagesOperations +from .operations import VirtualNetworksOperations +from .operations import SubnetsOperations +from .operations import ResourceNavigationLinksOperations +from .operations import ServiceAssociationLinksOperations +from .operations import VirtualNetworkPeeringsOperations +from .operations import VirtualNetworkGatewaysOperations +from .operations import VirtualNetworkGatewayConnectionsOperations +from .operations import LocalNetworkGatewaysOperations +from .operations import VirtualNetworkTapsOperations +from .operations import VirtualRoutersOperations +from .operations import VirtualRouterPeeringsOperations +from .operations import VirtualWansOperations +from .operations import VpnSitesOperations +from .operations import VpnSiteLinksOperations +from .operations import VpnSitesConfigurationOperations +from .operations import VpnServerConfigurationsOperations +from .operations import VirtualHubsOperations +from .operations import HubVirtualNetworkConnectionsOperations +from .operations import VpnGatewaysOperations +from .operations import VpnConnectionsOperations +from .operations import VpnSiteLinkConnectionsOperations +from .operations import VpnLinkConnectionsOperations +from .operations import P2SVpnGatewaysOperations +from .operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from .operations import VirtualHubRouteTableV2SOperations +from .operations import ExpressRouteGatewaysOperations +from .operations import ExpressRouteConnectionsOperations +from .operations import VirtualHubBgpConnectionOperations +from .operations import VirtualHubBgpConnectionsOperations +from .operations import VirtualHubIpConfigurationOperations +from .operations import HubRouteTablesOperations +from .operations import WebApplicationFirewallPoliciesOperations +from . import models + + +class NetworkManagementClient(NetworkManagementClientOperationsMixin): + """Network Client. + + :ivar application_gateways: ApplicationGatewaysOperations operations + :vartype application_gateways: azure.mgmt.network.v2020_07_01.operations.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: azure.mgmt.network.v2020_07_01.operations.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: azure.mgmt.network.v2020_07_01.operations.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: azure.mgmt.network.v2020_07_01.operations.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: azure.mgmt.network.v2020_07_01.operations.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations operations + :vartype available_resource_group_delegations: azure.mgmt.network.v2020_07_01.operations.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: azure.mgmt.network.v2020_07_01.operations.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2020_07_01.operations.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2020_07_01.operations.AzureFirewallFqdnTagsOperations + :ivar web_categories: WebCategoriesOperations operations + :vartype web_categories: azure.mgmt.network.v2020_07_01.operations.WebCategoriesOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2020_07_01.operations.BastionHostsOperations + :ivar custom_ip_prefixes: CustomIPPrefixesOperations operations + :vartype custom_ip_prefixes: azure.mgmt.network.v2020_07_01.operations.CustomIPPrefixesOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: azure.mgmt.network.v2020_07_01.operations.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: azure.mgmt.network.v2020_07_01.operations.DdosProtectionPlansOperations + :ivar dscp_configuration: DscpConfigurationOperations operations + :vartype dscp_configuration: azure.mgmt.network.v2020_07_01.operations.DscpConfigurationOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: azure.mgmt.network.v2020_07_01.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2020_07_01.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2020_07_01.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: azure.mgmt.network.v2020_07_01.operations.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations operations + :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2020_07_01.operations.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: azure.mgmt.network.v2020_07_01.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: azure.mgmt.network.v2020_07_01.operations.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: azure.mgmt.network.v2020_07_01.operations.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations operations + :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2020_07_01.operations.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: azure.mgmt.network.v2020_07_01.operations.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: azure.mgmt.network.v2020_07_01.operations.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: azure.mgmt.network.v2020_07_01.operations.ExpressRouteLinksOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: azure.mgmt.network.v2020_07_01.operations.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations operations + :vartype firewall_policy_rule_collection_groups: azure.mgmt.network.v2020_07_01.operations.FirewallPolicyRuleCollectionGroupsOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2020_07_01.operations.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2020_07_01.operations.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2020_07_01.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2020_07_01.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2020_07_01.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2020_07_01.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2020_07_01.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: azure.mgmt.network.v2020_07_01.operations.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2020_07_01.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: azure.mgmt.network.v2020_07_01.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2020_07_01.operations.NatGatewaysOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.network.v2020_07_01.operations.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2020_07_01.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2020_07_01.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations operations + :vartype network_interface_tap_configurations: azure.mgmt.network.v2020_07_01.operations.NetworkInterfaceTapConfigurationsOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2020_07_01.operations.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: azure.mgmt.network.v2020_07_01.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2020_07_01.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: azure.mgmt.network.v2020_07_01.operations.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: azure.mgmt.network.v2020_07_01.operations.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: azure.mgmt.network.v2020_07_01.operations.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: azure.mgmt.network.v2020_07_01.operations.VirtualApplianceSkusOperations + :ivar inbound_security_rule: InboundSecurityRuleOperations operations + :vartype inbound_security_rule: azure.mgmt.network.v2020_07_01.operations.InboundSecurityRuleOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2020_07_01.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2020_07_01.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: azure.mgmt.network.v2020_07_01.operations.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2020_07_01.operations.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2020_07_01.operations.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: azure.mgmt.network.v2020_07_01.operations.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: azure.mgmt.network.v2020_07_01.operations.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: azure.mgmt.network.v2020_07_01.operations.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: azure.mgmt.network.v2020_07_01.operations.PrivateLinkServicesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: azure.mgmt.network.v2020_07_01.operations.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: azure.mgmt.network.v2020_07_01.operations.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2020_07_01.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: azure.mgmt.network.v2020_07_01.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2020_07_01.operations.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2020_07_01.operations.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: azure.mgmt.network.v2020_07_01.operations.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: azure.mgmt.network.v2020_07_01.operations.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: azure.mgmt.network.v2020_07_01.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2020_07_01.operations.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2020_07_01.operations.ServiceTagsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2020_07_01.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2020_07_01.operations.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2020_07_01.operations.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: azure.mgmt.network.v2020_07_01.operations.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: azure.mgmt.network.v2020_07_01.operations.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: azure.mgmt.network.v2020_07_01.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: azure.mgmt.network.v2020_07_01.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2020_07_01.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: azure.mgmt.network.v2020_07_01.operations.LocalNetworkGatewaysOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: azure.mgmt.network.v2020_07_01.operations.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2020_07_01.operations.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: azure.mgmt.network.v2020_07_01.operations.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2020_07_01.operations.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2020_07_01.operations.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2020_07_01.operations.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: azure.mgmt.network.v2020_07_01.operations.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: azure.mgmt.network.v2020_07_01.operations.VpnServerConfigurationsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2020_07_01.operations.VirtualHubsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: azure.mgmt.network.v2020_07_01.operations.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2020_07_01.operations.VpnGatewaysOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2020_07_01.operations.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: azure.mgmt.network.v2020_07_01.operations.VpnSiteLinkConnectionsOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: azure.mgmt.network.v2020_07_01.operations.VpnLinkConnectionsOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2020_07_01.operations.P2SVpnGatewaysOperations + :ivar vpn_server_configurations_associated_with_virtual_wan: VpnServerConfigurationsAssociatedWithVirtualWanOperations operations + :vartype vpn_server_configurations_associated_with_virtual_wan: azure.mgmt.network.v2020_07_01.operations.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: azure.mgmt.network.v2020_07_01.operations.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: azure.mgmt.network.v2020_07_01.operations.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: azure.mgmt.network.v2020_07_01.operations.ExpressRouteConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: azure.mgmt.network.v2020_07_01.operations.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: azure.mgmt.network.v2020_07_01.operations.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: azure.mgmt.network.v2020_07_01.operations.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2020_07_01.operations.HubRouteTablesOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: azure.mgmt.network.v2020_07_01.operations.WebApplicationFirewallPoliciesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.application_gateways = ApplicationGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.application_gateway_private_link_resources = ApplicationGatewayPrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.application_gateway_private_endpoint_connections = ApplicationGatewayPrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.application_security_groups = ApplicationSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_delegations = AvailableDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_service_aliases = AvailableServiceAliasesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.azure_firewalls = AzureFirewallsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_categories = WebCategoriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bastion_hosts = BastionHostsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.custom_ip_prefixes = CustomIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ddos_custom_policies = DdosCustomPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ddos_protection_plans = DdosProtectionPlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dscp_configuration = DscpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_endpoint_services = AvailableEndpointServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuits = ExpressRouteCircuitsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_service_providers = ExpressRouteServiceProvidersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_ports_locations = ExpressRoutePortsLocationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_ports = ExpressRoutePortsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_links = ExpressRouteLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.firewall_policies = FirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.firewall_policy_rule_collection_groups = FirewallPolicyRuleCollectionGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ip_allocations = IpAllocationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ip_groups = IpGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inbound_nat_rules = InboundNatRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_probes = LoadBalancerProbesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nat_gateways = NatGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interfaces = NetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_profiles = NetworkProfilesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_security_groups = NetworkSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_rules = SecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.default_security_rules = DefaultSecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_virtual_appliances = NetworkVirtualAppliancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_appliance_sites = VirtualApplianceSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_appliance_skus = VirtualApplianceSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inbound_security_rule = InboundSecurityRuleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_watchers = NetworkWatchersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.packet_captures = PacketCapturesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.connection_monitors = ConnectionMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.flow_logs = FlowLogsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoints = PrivateEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_private_endpoint_types = AvailablePrivateEndpointTypesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_dns_zone_groups = PrivateDnsZoneGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_services = PrivateLinkServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.public_ip_addresses = PublicIPAddressesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.public_ip_prefixes = PublicIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.route_filters = RouteFiltersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.route_filter_rules = RouteFilterRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.route_tables = RouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.routes = RoutesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_partner_providers = SecurityPartnerProvidersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bgp_service_communities = BgpServiceCommunitiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_endpoint_policies = ServiceEndpointPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_tags = ServiceTagsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.subnets = SubnetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_navigation_links = ResourceNavigationLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_association_links = ServiceAssociationLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_peerings = VirtualNetworkPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_gateways = VirtualNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.local_network_gateways = LocalNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_taps = VirtualNetworkTapsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_routers = VirtualRoutersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_router_peerings = VirtualRouterPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_wans = VirtualWansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_sites = VpnSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_site_links = VpnSiteLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_sites_configuration = VpnSitesConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_server_configurations = VpnServerConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hubs = VirtualHubsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_gateways = VpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_connections = VpnConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_site_link_connections = VpnSiteLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_link_connections = VpnLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.p2_svpn_gateways = P2SVpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_server_configurations_associated_with_virtual_wan = VpnServerConfigurationsAssociatedWithVirtualWanOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_route_table_v2_s = VirtualHubRouteTableV2SOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_gateways = ExpressRouteGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_connections = ExpressRouteConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_bgp_connection = VirtualHubBgpConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_bgp_connections = VirtualHubBgpConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_ip_configuration = VirtualHubIpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hub_route_tables = HubRouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> NetworkManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/__init__.py new file mode 100644 index 0000000000000..1c78defcf2258 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._network_management_client import NetworkManagementClient +__all__ = ['NetworkManagementClient'] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/_configuration.py new file mode 100644 index 0000000000000..13d69e8606323 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class NetworkManagementClientConfiguration(Configuration): + """Configuration for NetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(NetworkManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-network/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/_network_management_client.py new file mode 100644 index 0000000000000..408d7633730b2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/_network_management_client.py @@ -0,0 +1,584 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import NetworkManagementClientConfiguration +from .operations import ApplicationGatewaysOperations +from .operations import ApplicationGatewayPrivateLinkResourcesOperations +from .operations import ApplicationGatewayPrivateEndpointConnectionsOperations +from .operations import ApplicationSecurityGroupsOperations +from .operations import AvailableDelegationsOperations +from .operations import AvailableResourceGroupDelegationsOperations +from .operations import AvailableServiceAliasesOperations +from .operations import AzureFirewallsOperations +from .operations import AzureFirewallFqdnTagsOperations +from .operations import WebCategoriesOperations +from .operations import BastionHostsOperations +from .operations import NetworkManagementClientOperationsMixin +from .operations import CustomIPPrefixesOperations +from .operations import DdosCustomPoliciesOperations +from .operations import DdosProtectionPlansOperations +from .operations import DscpConfigurationOperations +from .operations import AvailableEndpointServicesOperations +from .operations import ExpressRouteCircuitAuthorizationsOperations +from .operations import ExpressRouteCircuitPeeringsOperations +from .operations import ExpressRouteCircuitConnectionsOperations +from .operations import PeerExpressRouteCircuitConnectionsOperations +from .operations import ExpressRouteCircuitsOperations +from .operations import ExpressRouteServiceProvidersOperations +from .operations import ExpressRouteCrossConnectionsOperations +from .operations import ExpressRouteCrossConnectionPeeringsOperations +from .operations import ExpressRoutePortsLocationsOperations +from .operations import ExpressRoutePortsOperations +from .operations import ExpressRouteLinksOperations +from .operations import FirewallPoliciesOperations +from .operations import FirewallPolicyRuleCollectionGroupsOperations +from .operations import IpAllocationsOperations +from .operations import IpGroupsOperations +from .operations import LoadBalancersOperations +from .operations import LoadBalancerBackendAddressPoolsOperations +from .operations import LoadBalancerFrontendIPConfigurationsOperations +from .operations import InboundNatRulesOperations +from .operations import LoadBalancerLoadBalancingRulesOperations +from .operations import LoadBalancerOutboundRulesOperations +from .operations import LoadBalancerNetworkInterfacesOperations +from .operations import LoadBalancerProbesOperations +from .operations import NatGatewaysOperations +from .operations import NetworkInterfacesOperations +from .operations import NetworkInterfaceIPConfigurationsOperations +from .operations import NetworkInterfaceLoadBalancersOperations +from .operations import NetworkInterfaceTapConfigurationsOperations +from .operations import NetworkProfilesOperations +from .operations import NetworkSecurityGroupsOperations +from .operations import SecurityRulesOperations +from .operations import DefaultSecurityRulesOperations +from .operations import NetworkVirtualAppliancesOperations +from .operations import VirtualApplianceSitesOperations +from .operations import VirtualApplianceSkusOperations +from .operations import InboundSecurityRuleOperations +from .operations import NetworkWatchersOperations +from .operations import PacketCapturesOperations +from .operations import ConnectionMonitorsOperations +from .operations import FlowLogsOperations +from .operations import Operations +from .operations import PrivateEndpointsOperations +from .operations import AvailablePrivateEndpointTypesOperations +from .operations import PrivateDnsZoneGroupsOperations +from .operations import PrivateLinkServicesOperations +from .operations import PublicIPAddressesOperations +from .operations import PublicIPPrefixesOperations +from .operations import RouteFiltersOperations +from .operations import RouteFilterRulesOperations +from .operations import RouteTablesOperations +from .operations import RoutesOperations +from .operations import SecurityPartnerProvidersOperations +from .operations import BgpServiceCommunitiesOperations +from .operations import ServiceEndpointPoliciesOperations +from .operations import ServiceEndpointPolicyDefinitionsOperations +from .operations import ServiceTagsOperations +from .operations import UsagesOperations +from .operations import VirtualNetworksOperations +from .operations import SubnetsOperations +from .operations import ResourceNavigationLinksOperations +from .operations import ServiceAssociationLinksOperations +from .operations import VirtualNetworkPeeringsOperations +from .operations import VirtualNetworkGatewaysOperations +from .operations import VirtualNetworkGatewayConnectionsOperations +from .operations import LocalNetworkGatewaysOperations +from .operations import VirtualNetworkTapsOperations +from .operations import VirtualRoutersOperations +from .operations import VirtualRouterPeeringsOperations +from .operations import VirtualWansOperations +from .operations import VpnSitesOperations +from .operations import VpnSiteLinksOperations +from .operations import VpnSitesConfigurationOperations +from .operations import VpnServerConfigurationsOperations +from .operations import VirtualHubsOperations +from .operations import HubVirtualNetworkConnectionsOperations +from .operations import VpnGatewaysOperations +from .operations import VpnConnectionsOperations +from .operations import VpnSiteLinkConnectionsOperations +from .operations import VpnLinkConnectionsOperations +from .operations import P2SVpnGatewaysOperations +from .operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from .operations import VirtualHubRouteTableV2SOperations +from .operations import ExpressRouteGatewaysOperations +from .operations import ExpressRouteConnectionsOperations +from .operations import VirtualHubBgpConnectionOperations +from .operations import VirtualHubBgpConnectionsOperations +from .operations import VirtualHubIpConfigurationOperations +from .operations import HubRouteTablesOperations +from .operations import WebApplicationFirewallPoliciesOperations +from .. import models + + +class NetworkManagementClient(NetworkManagementClientOperationsMixin): + """Network Client. + + :ivar application_gateways: ApplicationGatewaysOperations operations + :vartype application_gateways: azure.mgmt.network.v2020_07_01.aio.operations.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: azure.mgmt.network.v2020_07_01.aio.operations.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: azure.mgmt.network.v2020_07_01.aio.operations.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: azure.mgmt.network.v2020_07_01.aio.operations.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: azure.mgmt.network.v2020_07_01.aio.operations.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations operations + :vartype available_resource_group_delegations: azure.mgmt.network.v2020_07_01.aio.operations.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: azure.mgmt.network.v2020_07_01.aio.operations.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2020_07_01.aio.operations.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2020_07_01.aio.operations.AzureFirewallFqdnTagsOperations + :ivar web_categories: WebCategoriesOperations operations + :vartype web_categories: azure.mgmt.network.v2020_07_01.aio.operations.WebCategoriesOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2020_07_01.aio.operations.BastionHostsOperations + :ivar custom_ip_prefixes: CustomIPPrefixesOperations operations + :vartype custom_ip_prefixes: azure.mgmt.network.v2020_07_01.aio.operations.CustomIPPrefixesOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: azure.mgmt.network.v2020_07_01.aio.operations.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: azure.mgmt.network.v2020_07_01.aio.operations.DdosProtectionPlansOperations + :ivar dscp_configuration: DscpConfigurationOperations operations + :vartype dscp_configuration: azure.mgmt.network.v2020_07_01.aio.operations.DscpConfigurationOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: azure.mgmt.network.v2020_07_01.aio.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations operations + :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2020_07_01.aio.operations.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations operations + :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteLinksOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: azure.mgmt.network.v2020_07_01.aio.operations.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations operations + :vartype firewall_policy_rule_collection_groups: azure.mgmt.network.v2020_07_01.aio.operations.FirewallPolicyRuleCollectionGroupsOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2020_07_01.aio.operations.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2020_07_01.aio.operations.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2020_07_01.aio.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: azure.mgmt.network.v2020_07_01.aio.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2020_07_01.aio.operations.NatGatewaysOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.network.v2020_07_01.aio.operations.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2020_07_01.aio.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2020_07_01.aio.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations operations + :vartype network_interface_tap_configurations: azure.mgmt.network.v2020_07_01.aio.operations.NetworkInterfaceTapConfigurationsOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2020_07_01.aio.operations.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: azure.mgmt.network.v2020_07_01.aio.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2020_07_01.aio.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: azure.mgmt.network.v2020_07_01.aio.operations.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: azure.mgmt.network.v2020_07_01.aio.operations.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: azure.mgmt.network.v2020_07_01.aio.operations.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: azure.mgmt.network.v2020_07_01.aio.operations.VirtualApplianceSkusOperations + :ivar inbound_security_rule: InboundSecurityRuleOperations operations + :vartype inbound_security_rule: azure.mgmt.network.v2020_07_01.aio.operations.InboundSecurityRuleOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2020_07_01.aio.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2020_07_01.aio.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: azure.mgmt.network.v2020_07_01.aio.operations.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2020_07_01.aio.operations.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2020_07_01.aio.operations.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: azure.mgmt.network.v2020_07_01.aio.operations.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: azure.mgmt.network.v2020_07_01.aio.operations.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: azure.mgmt.network.v2020_07_01.aio.operations.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: azure.mgmt.network.v2020_07_01.aio.operations.PrivateLinkServicesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: azure.mgmt.network.v2020_07_01.aio.operations.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: azure.mgmt.network.v2020_07_01.aio.operations.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2020_07_01.aio.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: azure.mgmt.network.v2020_07_01.aio.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2020_07_01.aio.operations.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2020_07_01.aio.operations.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: azure.mgmt.network.v2020_07_01.aio.operations.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: azure.mgmt.network.v2020_07_01.aio.operations.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: azure.mgmt.network.v2020_07_01.aio.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2020_07_01.aio.operations.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2020_07_01.aio.operations.ServiceTagsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2020_07_01.aio.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2020_07_01.aio.operations.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2020_07_01.aio.operations.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: azure.mgmt.network.v2020_07_01.aio.operations.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: azure.mgmt.network.v2020_07_01.aio.operations.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: azure.mgmt.network.v2020_07_01.aio.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: azure.mgmt.network.v2020_07_01.aio.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2020_07_01.aio.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: azure.mgmt.network.v2020_07_01.aio.operations.LocalNetworkGatewaysOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: azure.mgmt.network.v2020_07_01.aio.operations.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2020_07_01.aio.operations.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: azure.mgmt.network.v2020_07_01.aio.operations.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2020_07_01.aio.operations.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2020_07_01.aio.operations.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2020_07_01.aio.operations.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: azure.mgmt.network.v2020_07_01.aio.operations.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: azure.mgmt.network.v2020_07_01.aio.operations.VpnServerConfigurationsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2020_07_01.aio.operations.VirtualHubsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: azure.mgmt.network.v2020_07_01.aio.operations.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2020_07_01.aio.operations.VpnGatewaysOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2020_07_01.aio.operations.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: azure.mgmt.network.v2020_07_01.aio.operations.VpnSiteLinkConnectionsOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: azure.mgmt.network.v2020_07_01.aio.operations.VpnLinkConnectionsOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2020_07_01.aio.operations.P2SVpnGatewaysOperations + :ivar vpn_server_configurations_associated_with_virtual_wan: VpnServerConfigurationsAssociatedWithVirtualWanOperations operations + :vartype vpn_server_configurations_associated_with_virtual_wan: azure.mgmt.network.v2020_07_01.aio.operations.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: azure.mgmt.network.v2020_07_01.aio.operations.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: azure.mgmt.network.v2020_07_01.aio.operations.ExpressRouteConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: azure.mgmt.network.v2020_07_01.aio.operations.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: azure.mgmt.network.v2020_07_01.aio.operations.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: azure.mgmt.network.v2020_07_01.aio.operations.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2020_07_01.aio.operations.HubRouteTablesOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: azure.mgmt.network.v2020_07_01.aio.operations.WebApplicationFirewallPoliciesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.application_gateways = ApplicationGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.application_gateway_private_link_resources = ApplicationGatewayPrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.application_gateway_private_endpoint_connections = ApplicationGatewayPrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.application_security_groups = ApplicationSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_delegations = AvailableDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_resource_group_delegations = AvailableResourceGroupDelegationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_service_aliases = AvailableServiceAliasesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.azure_firewalls = AzureFirewallsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.azure_firewall_fqdn_tags = AzureFirewallFqdnTagsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_categories = WebCategoriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bastion_hosts = BastionHostsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.custom_ip_prefixes = CustomIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ddos_custom_policies = DdosCustomPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ddos_protection_plans = DdosProtectionPlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dscp_configuration = DscpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_endpoint_services = AvailableEndpointServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuit_connections = ExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.peer_express_route_circuit_connections = PeerExpressRouteCircuitConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_circuits = ExpressRouteCircuitsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_service_providers = ExpressRouteServiceProvidersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_cross_connections = ExpressRouteCrossConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_cross_connection_peerings = ExpressRouteCrossConnectionPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_ports_locations = ExpressRoutePortsLocationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_ports = ExpressRoutePortsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_links = ExpressRouteLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.firewall_policies = FirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.firewall_policy_rule_collection_groups = FirewallPolicyRuleCollectionGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ip_allocations = IpAllocationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ip_groups = IpGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inbound_nat_rules = InboundNatRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_outbound_rules = LoadBalancerOutboundRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.load_balancer_probes = LoadBalancerProbesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.nat_gateways = NatGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interfaces = NetworkInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_interface_tap_configurations = NetworkInterfaceTapConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_profiles = NetworkProfilesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_security_groups = NetworkSecurityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_rules = SecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.default_security_rules = DefaultSecurityRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_virtual_appliances = NetworkVirtualAppliancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_appliance_sites = VirtualApplianceSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_appliance_skus = VirtualApplianceSkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inbound_security_rule = InboundSecurityRuleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.network_watchers = NetworkWatchersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.packet_captures = PacketCapturesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.connection_monitors = ConnectionMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.flow_logs = FlowLogsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoints = PrivateEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.available_private_endpoint_types = AvailablePrivateEndpointTypesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_dns_zone_groups = PrivateDnsZoneGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_services = PrivateLinkServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.public_ip_addresses = PublicIPAddressesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.public_ip_prefixes = PublicIPPrefixesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.route_filters = RouteFiltersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.route_filter_rules = RouteFilterRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.route_tables = RouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.routes = RoutesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_partner_providers = SecurityPartnerProvidersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bgp_service_communities = BgpServiceCommunitiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_endpoint_policies = ServiceEndpointPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_tags = ServiceTagsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.subnets = SubnetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_navigation_links = ResourceNavigationLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service_association_links = ServiceAssociationLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_peerings = VirtualNetworkPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_gateways = VirtualNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.local_network_gateways = LocalNetworkGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_network_taps = VirtualNetworkTapsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_routers = VirtualRoutersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_router_peerings = VirtualRouterPeeringsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_wans = VirtualWansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_sites = VpnSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_site_links = VpnSiteLinksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_sites_configuration = VpnSitesConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_server_configurations = VpnServerConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hubs = VirtualHubsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hub_virtual_network_connections = HubVirtualNetworkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_gateways = VpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_connections = VpnConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_site_link_connections = VpnSiteLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_link_connections = VpnLinkConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.p2_svpn_gateways = P2SVpnGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vpn_server_configurations_associated_with_virtual_wan = VpnServerConfigurationsAssociatedWithVirtualWanOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_route_table_v2_s = VirtualHubRouteTableV2SOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_gateways = ExpressRouteGatewaysOperations( + self._client, self._config, self._serialize, self._deserialize) + self.express_route_connections = ExpressRouteConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_bgp_connection = VirtualHubBgpConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_bgp_connections = VirtualHubBgpConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_hub_ip_configuration = VirtualHubIpConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hub_route_tables = HubRouteTablesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_application_firewall_policies = WebApplicationFirewallPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "NetworkManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/__init__.py new file mode 100644 index 0000000000000..579cf30e3f804 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/__init__.py @@ -0,0 +1,223 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._application_gateways_operations import ApplicationGatewaysOperations +from ._application_gateway_private_link_resources_operations import ApplicationGatewayPrivateLinkResourcesOperations +from ._application_gateway_private_endpoint_connections_operations import ApplicationGatewayPrivateEndpointConnectionsOperations +from ._application_security_groups_operations import ApplicationSecurityGroupsOperations +from ._available_delegations_operations import AvailableDelegationsOperations +from ._available_resource_group_delegations_operations import AvailableResourceGroupDelegationsOperations +from ._available_service_aliases_operations import AvailableServiceAliasesOperations +from ._azure_firewalls_operations import AzureFirewallsOperations +from ._azure_firewall_fqdn_tags_operations import AzureFirewallFqdnTagsOperations +from ._web_categories_operations import WebCategoriesOperations +from ._bastion_hosts_operations import BastionHostsOperations +from ._network_management_client_operations import NetworkManagementClientOperationsMixin +from ._custom_ip_prefixes_operations import CustomIPPrefixesOperations +from ._ddos_custom_policies_operations import DdosCustomPoliciesOperations +from ._ddos_protection_plans_operations import DdosProtectionPlansOperations +from ._dscp_configuration_operations import DscpConfigurationOperations +from ._available_endpoint_services_operations import AvailableEndpointServicesOperations +from ._express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations +from ._express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations +from ._express_route_circuit_connections_operations import ExpressRouteCircuitConnectionsOperations +from ._peer_express_route_circuit_connections_operations import PeerExpressRouteCircuitConnectionsOperations +from ._express_route_circuits_operations import ExpressRouteCircuitsOperations +from ._express_route_service_providers_operations import ExpressRouteServiceProvidersOperations +from ._express_route_cross_connections_operations import ExpressRouteCrossConnectionsOperations +from ._express_route_cross_connection_peerings_operations import ExpressRouteCrossConnectionPeeringsOperations +from ._express_route_ports_locations_operations import ExpressRoutePortsLocationsOperations +from ._express_route_ports_operations import ExpressRoutePortsOperations +from ._express_route_links_operations import ExpressRouteLinksOperations +from ._firewall_policies_operations import FirewallPoliciesOperations +from ._firewall_policy_rule_collection_groups_operations import FirewallPolicyRuleCollectionGroupsOperations +from ._ip_allocations_operations import IpAllocationsOperations +from ._ip_groups_operations import IpGroupsOperations +from ._load_balancers_operations import LoadBalancersOperations +from ._load_balancer_backend_address_pools_operations import LoadBalancerBackendAddressPoolsOperations +from ._load_balancer_frontend_ip_configurations_operations import LoadBalancerFrontendIPConfigurationsOperations +from ._inbound_nat_rules_operations import InboundNatRulesOperations +from ._load_balancer_load_balancing_rules_operations import LoadBalancerLoadBalancingRulesOperations +from ._load_balancer_outbound_rules_operations import LoadBalancerOutboundRulesOperations +from ._load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations +from ._load_balancer_probes_operations import LoadBalancerProbesOperations +from ._nat_gateways_operations import NatGatewaysOperations +from ._network_interfaces_operations import NetworkInterfacesOperations +from ._network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations +from ._network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations +from ._network_interface_tap_configurations_operations import NetworkInterfaceTapConfigurationsOperations +from ._network_profiles_operations import NetworkProfilesOperations +from ._network_security_groups_operations import NetworkSecurityGroupsOperations +from ._security_rules_operations import SecurityRulesOperations +from ._default_security_rules_operations import DefaultSecurityRulesOperations +from ._network_virtual_appliances_operations import NetworkVirtualAppliancesOperations +from ._virtual_appliance_sites_operations import VirtualApplianceSitesOperations +from ._virtual_appliance_skus_operations import VirtualApplianceSkusOperations +from ._inbound_security_rule_operations import InboundSecurityRuleOperations +from ._network_watchers_operations import NetworkWatchersOperations +from ._packet_captures_operations import PacketCapturesOperations +from ._connection_monitors_operations import ConnectionMonitorsOperations +from ._flow_logs_operations import FlowLogsOperations +from ._operations import Operations +from ._private_endpoints_operations import PrivateEndpointsOperations +from ._available_private_endpoint_types_operations import AvailablePrivateEndpointTypesOperations +from ._private_dns_zone_groups_operations import PrivateDnsZoneGroupsOperations +from ._private_link_services_operations import PrivateLinkServicesOperations +from ._public_ip_addresses_operations import PublicIPAddressesOperations +from ._public_ip_prefixes_operations import PublicIPPrefixesOperations +from ._route_filters_operations import RouteFiltersOperations +from ._route_filter_rules_operations import RouteFilterRulesOperations +from ._route_tables_operations import RouteTablesOperations +from ._routes_operations import RoutesOperations +from ._security_partner_providers_operations import SecurityPartnerProvidersOperations +from ._bgp_service_communities_operations import BgpServiceCommunitiesOperations +from ._service_endpoint_policies_operations import ServiceEndpointPoliciesOperations +from ._service_endpoint_policy_definitions_operations import ServiceEndpointPolicyDefinitionsOperations +from ._service_tags_operations import ServiceTagsOperations +from ._usages_operations import UsagesOperations +from ._virtual_networks_operations import VirtualNetworksOperations +from ._subnets_operations import SubnetsOperations +from ._resource_navigation_links_operations import ResourceNavigationLinksOperations +from ._service_association_links_operations import ServiceAssociationLinksOperations +from ._virtual_network_peerings_operations import VirtualNetworkPeeringsOperations +from ._virtual_network_gateways_operations import VirtualNetworkGatewaysOperations +from ._virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations +from ._local_network_gateways_operations import LocalNetworkGatewaysOperations +from ._virtual_network_taps_operations import VirtualNetworkTapsOperations +from ._virtual_routers_operations import VirtualRoutersOperations +from ._virtual_router_peerings_operations import VirtualRouterPeeringsOperations +from ._virtual_wans_operations import VirtualWansOperations +from ._vpn_sites_operations import VpnSitesOperations +from ._vpn_site_links_operations import VpnSiteLinksOperations +from ._vpn_sites_configuration_operations import VpnSitesConfigurationOperations +from ._vpn_server_configurations_operations import VpnServerConfigurationsOperations +from ._virtual_hubs_operations import VirtualHubsOperations +from ._hub_virtual_network_connections_operations import HubVirtualNetworkConnectionsOperations +from ._vpn_gateways_operations import VpnGatewaysOperations +from ._vpn_connections_operations import VpnConnectionsOperations +from ._vpn_site_link_connections_operations import VpnSiteLinkConnectionsOperations +from ._vpn_link_connections_operations import VpnLinkConnectionsOperations +from ._p2_svpn_gateways_operations import P2SVpnGatewaysOperations +from ._vpn_server_configurations_associated_with_virtual_wan_operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from ._virtual_hub_route_table_v2_s_operations import VirtualHubRouteTableV2SOperations +from ._express_route_gateways_operations import ExpressRouteGatewaysOperations +from ._express_route_connections_operations import ExpressRouteConnectionsOperations +from ._virtual_hub_bgp_connection_operations import VirtualHubBgpConnectionOperations +from ._virtual_hub_bgp_connections_operations import VirtualHubBgpConnectionsOperations +from ._virtual_hub_ip_configuration_operations import VirtualHubIpConfigurationOperations +from ._hub_route_tables_operations import HubRouteTablesOperations +from ._web_application_firewall_policies_operations import WebApplicationFirewallPoliciesOperations + +__all__ = [ + 'ApplicationGatewaysOperations', + 'ApplicationGatewayPrivateLinkResourcesOperations', + 'ApplicationGatewayPrivateEndpointConnectionsOperations', + 'ApplicationSecurityGroupsOperations', + 'AvailableDelegationsOperations', + 'AvailableResourceGroupDelegationsOperations', + 'AvailableServiceAliasesOperations', + 'AzureFirewallsOperations', + 'AzureFirewallFqdnTagsOperations', + 'WebCategoriesOperations', + 'BastionHostsOperations', + 'NetworkManagementClientOperationsMixin', + 'CustomIPPrefixesOperations', + 'DdosCustomPoliciesOperations', + 'DdosProtectionPlansOperations', + 'DscpConfigurationOperations', + 'AvailableEndpointServicesOperations', + 'ExpressRouteCircuitAuthorizationsOperations', + 'ExpressRouteCircuitPeeringsOperations', + 'ExpressRouteCircuitConnectionsOperations', + 'PeerExpressRouteCircuitConnectionsOperations', + 'ExpressRouteCircuitsOperations', + 'ExpressRouteServiceProvidersOperations', + 'ExpressRouteCrossConnectionsOperations', + 'ExpressRouteCrossConnectionPeeringsOperations', + 'ExpressRoutePortsLocationsOperations', + 'ExpressRoutePortsOperations', + 'ExpressRouteLinksOperations', + 'FirewallPoliciesOperations', + 'FirewallPolicyRuleCollectionGroupsOperations', + 'IpAllocationsOperations', + 'IpGroupsOperations', + 'LoadBalancersOperations', + 'LoadBalancerBackendAddressPoolsOperations', + 'LoadBalancerFrontendIPConfigurationsOperations', + 'InboundNatRulesOperations', + 'LoadBalancerLoadBalancingRulesOperations', + 'LoadBalancerOutboundRulesOperations', + 'LoadBalancerNetworkInterfacesOperations', + 'LoadBalancerProbesOperations', + 'NatGatewaysOperations', + 'NetworkInterfacesOperations', + 'NetworkInterfaceIPConfigurationsOperations', + 'NetworkInterfaceLoadBalancersOperations', + 'NetworkInterfaceTapConfigurationsOperations', + 'NetworkProfilesOperations', + 'NetworkSecurityGroupsOperations', + 'SecurityRulesOperations', + 'DefaultSecurityRulesOperations', + 'NetworkVirtualAppliancesOperations', + 'VirtualApplianceSitesOperations', + 'VirtualApplianceSkusOperations', + 'InboundSecurityRuleOperations', + 'NetworkWatchersOperations', + 'PacketCapturesOperations', + 'ConnectionMonitorsOperations', + 'FlowLogsOperations', + 'Operations', + 'PrivateEndpointsOperations', + 'AvailablePrivateEndpointTypesOperations', + 'PrivateDnsZoneGroupsOperations', + 'PrivateLinkServicesOperations', + 'PublicIPAddressesOperations', + 'PublicIPPrefixesOperations', + 'RouteFiltersOperations', + 'RouteFilterRulesOperations', + 'RouteTablesOperations', + 'RoutesOperations', + 'SecurityPartnerProvidersOperations', + 'BgpServiceCommunitiesOperations', + 'ServiceEndpointPoliciesOperations', + 'ServiceEndpointPolicyDefinitionsOperations', + 'ServiceTagsOperations', + 'UsagesOperations', + 'VirtualNetworksOperations', + 'SubnetsOperations', + 'ResourceNavigationLinksOperations', + 'ServiceAssociationLinksOperations', + 'VirtualNetworkPeeringsOperations', + 'VirtualNetworkGatewaysOperations', + 'VirtualNetworkGatewayConnectionsOperations', + 'LocalNetworkGatewaysOperations', + 'VirtualNetworkTapsOperations', + 'VirtualRoutersOperations', + 'VirtualRouterPeeringsOperations', + 'VirtualWansOperations', + 'VpnSitesOperations', + 'VpnSiteLinksOperations', + 'VpnSitesConfigurationOperations', + 'VpnServerConfigurationsOperations', + 'VirtualHubsOperations', + 'HubVirtualNetworkConnectionsOperations', + 'VpnGatewaysOperations', + 'VpnConnectionsOperations', + 'VpnSiteLinkConnectionsOperations', + 'VpnLinkConnectionsOperations', + 'P2SVpnGatewaysOperations', + 'VpnServerConfigurationsAssociatedWithVirtualWanOperations', + 'VirtualHubRouteTableV2SOperations', + 'ExpressRouteGatewaysOperations', + 'ExpressRouteConnectionsOperations', + 'VirtualHubBgpConnectionOperations', + 'VirtualHubBgpConnectionsOperations', + 'VirtualHubIpConfigurationOperations', + 'HubRouteTablesOperations', + 'WebApplicationFirewallPoliciesOperations', +] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..d600fcf3df5af --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py @@ -0,0 +1,429 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationGatewayPrivateEndpointConnectionsOperations: + """ApplicationGatewayPrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: "_models.ApplicationGatewayPrivateEndpointConnection", + **kwargs + ) -> Optional["_models.ApplicationGatewayPrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayPrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ApplicationGatewayPrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + parameters: "_models.ApplicationGatewayPrivateEndpointConnection", + **kwargs + ) -> AsyncLROPoller["_models.ApplicationGatewayPrivateEndpointConnection"]: + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + application_gateway_name: str, + connection_name: str, + **kwargs + ) -> "_models.ApplicationGatewayPrivateEndpointConnection": + """Gets the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewayPrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> AsyncIterable["_models.ApplicationGatewayPrivateEndpointConnectionListResult"]: + """Lists all private endpoint connections on an application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayPrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateway_private_link_resources_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateway_private_link_resources_operations.py new file mode 100644 index 0000000000000..336eae67f0f9f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateway_private_link_resources_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationGatewayPrivateLinkResourcesOperations: + """ApplicationGatewayPrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> AsyncIterable["_models.ApplicationGatewayPrivateLinkResourceListResult"]: + """Lists all private link resources on an application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayPrivateLinkResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayPrivateLinkResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateways_operations.py new file mode 100644 index 0000000000000..4183efaa781b2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_gateways_operations.py @@ -0,0 +1,1386 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationGatewaysOperations: + """ApplicationGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> "_models.ApplicationGateway": + """Gets the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: "_models.ApplicationGateway", + **kwargs + ) -> "_models.ApplicationGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ApplicationGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: "_models.ApplicationGateway", + **kwargs + ) -> AsyncLROPoller["_models.ApplicationGateway"]: + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ApplicationGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + application_gateway_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ApplicationGateway": + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: + """Lists all application gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: + """Gets all the application gateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Starts the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore + + async def begin_stop( + self, + resource_group_name: str, + application_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Stops the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore + + async def _backend_health_initial( + self, + resource_group_name: str, + application_gateway_name: str, + expand: Optional[str] = None, + **kwargs + ) -> Optional["_models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._backend_health_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _backend_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore + + async def begin_backend_health( + self, + resource_group_name: str, + application_gateway_name: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: + """Gets the backend health of the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._backend_health_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + expand=expand, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore + + async def _backend_health_on_demand_initial( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: "_models.ApplicationGatewayOnDemandProbe", + expand: Optional[str] = None, + **kwargs + ) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._backend_health_on_demand_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayBackendHealthOnDemand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _backend_health_on_demand_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand'} # type: ignore + + async def begin_backend_health_on_demand( + self, + resource_group_name: str, + application_gateway_name: str, + probe_request: "_models.ApplicationGatewayOnDemandProbe", + expand: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealthOnDemand"]: + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. + :type probe_request: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayOnDemandProbe + :param expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._backend_health_on_demand_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + probe_request=probe_request, + expand=expand, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayBackendHealthOnDemand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_backend_health_on_demand.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand'} # type: ignore + + async def list_available_server_variables( + self, + **kwargs + ) -> List[str]: + """Lists all available server variables. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_server_variables.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_server_variables.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables'} # type: ignore + + async def list_available_request_headers( + self, + **kwargs + ) -> List[str]: + """Lists all available request headers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_request_headers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_request_headers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders'} # type: ignore + + async def list_available_response_headers( + self, + **kwargs + ) -> List[str]: + """Lists all available response headers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_response_headers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_response_headers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders'} # type: ignore + + async def list_available_waf_rule_sets( + self, + **kwargs + ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": + """Lists all available web application firewall rule sets. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewayAvailableWafRuleSetsResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_waf_rule_sets.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewayAvailableWafRuleSetsResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} # type: ignore + + async def list_available_ssl_options( + self, + **kwargs + ) -> "_models.ApplicationGatewayAvailableSslOptions": + """Lists available Ssl options for configuring Ssl policy. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewayAvailableSslOptions, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAvailableSslOptions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_ssl_options.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewayAvailableSslOptions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} # type: ignore + + def list_available_ssl_predefined_policies( + self, + **kwargs + ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: + """Lists all SSL predefined policies for configuring Ssl policy. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayAvailableSslPredefinedPolicies or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayAvailableSslPredefinedPolicies', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} # type: ignore + + async def get_ssl_predefined_policy( + self, + predefined_policy_name: str, + **kwargs + ) -> "_models.ApplicationGatewaySslPredefinedPolicy": + """Gets Ssl predefined policy with the specified policy name. + + :param predefined_policy_name: Name of Ssl predefined policy. + :type predefined_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewaySslPredefinedPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPredefinedPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_ssl_predefined_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewaySslPredefinedPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_security_groups_operations.py new file mode 100644 index 0000000000000..8b3dfa26af2f1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_application_security_groups_operations.py @@ -0,0 +1,541 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationSecurityGroupsOperations: + """ApplicationSecurityGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + application_security_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + application_security_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + application_security_group_name: str, + **kwargs + ) -> "_models.ApplicationSecurityGroup": + """Gets information about the specified application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: "_models.ApplicationSecurityGroup", + **kwargs + ) -> "_models.ApplicationSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: "_models.ApplicationSecurityGroup", + **kwargs + ) -> AsyncLROPoller["_models.ApplicationSecurityGroup"]: + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + application_security_group_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ApplicationSecurityGroup": + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: + """Gets all application security groups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ApplicationSecurityGroupListResult"]: + """Gets all the application security groups in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_delegations_operations.py new file mode 100644 index 0000000000000..1b7239666f543 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_delegations_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableDelegationsOperations: + """AvailableDelegationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: + """Gets all of the available subnet delegations for this subscription in this region. + + :param location: The location of the subnet. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableDelegationsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableDelegationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_endpoint_services_operations.py new file mode 100644 index 0000000000000..1db5e74bfe74a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_endpoint_services_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableEndpointServicesOperations: + """AvailableEndpointServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.EndpointServicesListResult"]: + """List what values of endpoint services are available for use. + + :param location: The location to check available endpoint services. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EndpointServicesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.EndpointServicesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EndpointServicesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_private_endpoint_types_operations.py new file mode 100644 index 0000000000000..1db7e4fdb2be4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_private_endpoint_types_operations.py @@ -0,0 +1,188 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailablePrivateEndpointTypesOperations: + """AvailablePrivateEndpointTypesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailablePrivateEndpointTypesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailablePrivateEndpointTypesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes'} # type: ignore + + def list_by_resource_group( + self, + location: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AvailablePrivateEndpointTypesResult"]: + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailablePrivateEndpointTypesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailablePrivateEndpointTypesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_resource_group_delegations_operations.py new file mode 100644 index 0000000000000..45a4b5663b322 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_resource_group_delegations_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableResourceGroupDelegationsOperations: + """AvailableResourceGroupDelegationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AvailableDelegationsResult"]: + """Gets all of the available subnet delegations for this resource group in this region. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableDelegationsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableDelegationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_service_aliases_operations.py new file mode 100644 index 0000000000000..067fd0e775e0e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_available_service_aliases_operations.py @@ -0,0 +1,186 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AvailableServiceAliasesOperations: + """AvailableServiceAliasesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: + """Gets all available service aliases for this subscription in this region. + + :param location: The location. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableServiceAliasesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableServiceAliasesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + location: str, + **kwargs + ) -> AsyncIterable["_models.AvailableServiceAliasesResult"]: + """Gets all available service aliases for this resource group in this region. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param location: The location. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableServiceAliasesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableServiceAliasesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py new file mode 100644 index 0000000000000..d47c68f8df792 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_azure_firewall_fqdn_tags_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AzureFirewallFqdnTagsOperations: + """AzureFirewallFqdnTagsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.AzureFirewallFqdnTagListResult"]: + """Gets all the Azure Firewall FQDN Tags in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureFirewallFqdnTagListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureFirewallFqdnTagListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AzureFirewallFqdnTagListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_azure_firewalls_operations.py new file mode 100644 index 0000000000000..ab208cc75966c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_azure_firewalls_operations.py @@ -0,0 +1,600 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AzureFirewallsOperations: + """AzureFirewallsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + azure_firewall_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + azure_firewall_name: str, + **kwargs + ) -> "_models.AzureFirewall": + """Gets the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureFirewall, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.AzureFirewall + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: "_models.AzureFirewall", + **kwargs + ) -> "_models.AzureFirewall": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AzureFirewall') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: "_models.AzureFirewall", + **kwargs + ) -> AsyncLROPoller["_models.AzureFirewall"]: + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.AzureFirewall + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> Optional["_models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + azure_firewall_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> AsyncLROPoller["_models.AzureFirewall"]: + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AzureFirewallListResult"]: + """Lists all Azure Firewalls in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureFirewallListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AzureFirewallListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.AzureFirewallListResult"]: + """Gets all the Azure Firewalls in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureFirewallListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AzureFirewallListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_bastion_hosts_operations.py new file mode 100644 index 0000000000000..45df90b982103 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_bastion_hosts_operations.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BastionHostsOperations: + """BastionHostsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + bastion_host_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + bastion_host_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Bastion Host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + bastion_host_name: str, + **kwargs + ) -> "_models.BastionHost": + """Gets the specified Bastion Host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BastionHost, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.BastionHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BastionHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: "_models.BastionHost", + **kwargs + ) -> "_models.BastionHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BastionHost') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BastionHost', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BastionHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + bastion_host_name: str, + parameters: "_models.BastionHost", + **kwargs + ) -> AsyncLROPoller["_models.BastionHost"]: + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.BastionHost + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BastionHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.BastionHostListResult"]: + """Lists all Bastion Hosts in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionHostListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BastionHostListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.BastionHostListResult"]: + """Lists all Bastion Hosts in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionHostListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BastionHostListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_bgp_service_communities_operations.py new file mode 100644 index 0000000000000..6d9cd3805e2de --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_bgp_service_communities_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BgpServiceCommunitiesOperations: + """BgpServiceCommunitiesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: + """Gets all the available bgp service communities. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BgpServiceCommunityListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BgpServiceCommunityListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BgpServiceCommunityListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_connection_monitors_operations.py new file mode 100644 index 0000000000000..fd8cf1ca39ad2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_connection_monitors_operations.py @@ -0,0 +1,870 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConnectionMonitorsOperations: + """ConnectionMonitorsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: "_models.ConnectionMonitor", + migrate: Optional[str] = None, + **kwargs + ) -> "_models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if migrate is not None: + query_parameters['migrate'] = self._serialize.query("migrate", migrate, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectionMonitor') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: "_models.ConnectionMonitor", + migrate: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["_models.ConnectionMonitorResult"]: + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitor + :param migrate: Value indicating whether connection monitor V1 should be migrated to V2 format. + :type migrate: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + parameters=parameters, + migrate=migrate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> "_models.ConnectionMonitorResult": + """Gets a connection monitor by name. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionMonitorResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ConnectionMonitorResult": + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionMonitorResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} # type: ignore + + async def begin_stop( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Stops the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Starts the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} # type: ignore + + async def _query_initial( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> "_models.ConnectionMonitorQueryResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._query_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _query_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} # type: ignore + + async def begin_query( + self, + resource_group_name: str, + network_watcher_name: str, + connection_monitor_name: str, + **kwargs + ) -> AsyncLROPoller["_models.ConnectionMonitorQueryResult"]: + """Query a snapshot of the most recent connection states. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name given to the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorQueryResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._query_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} # type: ignore + + def list( + self, + resource_group_name: str, + network_watcher_name: str, + **kwargs + ) -> AsyncIterable["_models.ConnectionMonitorListResult"]: + """Lists all connection monitors for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConnectionMonitorListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConnectionMonitorListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_custom_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_custom_ip_prefixes_operations.py new file mode 100644 index 0000000000000..ac2d73fefcaba --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_custom_ip_prefixes_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CustomIPPrefixesOperations: + """CustomIPPrefixesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified custom IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the CustomIpPrefix. + :type custom_ip_prefix_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.CustomIpPrefix": + """Gets the specified custom IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. + :type custom_ip_prefix_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomIpPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: "_models.CustomIpPrefix", + **kwargs + ) -> "_models.CustomIpPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CustomIpPrefix') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: "_models.CustomIpPrefix", + **kwargs + ) -> AsyncLROPoller["_models.CustomIpPrefix"]: + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CustomIpPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + custom_ip_prefix_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.CustomIpPrefix": + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomIpPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.CustomIpPrefixListResult"]: + """Gets all the custom IP prefixes in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CustomIpPrefixListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CustomIpPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.CustomIpPrefixListResult"]: + """Gets all custom IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CustomIpPrefixListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CustomIpPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ddos_custom_policies_operations.py new file mode 100644 index 0000000000000..df07304447b11 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ddos_custom_policies_operations.py @@ -0,0 +1,403 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DdosCustomPoliciesOperations: + """DdosCustomPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + **kwargs + ) -> "_models.DdosCustomPolicy": + """Gets information about the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosCustomPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: "_models.DdosCustomPolicy", + **kwargs + ) -> "_models.DdosCustomPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DdosCustomPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: "_models.DdosCustomPolicy", + **kwargs + ) -> AsyncLROPoller["_models.DdosCustomPolicy"]: + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + ddos_custom_policy_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.DdosCustomPolicy": + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosCustomPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ddos_protection_plans_operations.py new file mode 100644 index 0000000000000..45afdffc553b2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ddos_protection_plans_operations.py @@ -0,0 +1,540 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DdosProtectionPlansOperations: + """DdosProtectionPlansOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + **kwargs + ) -> "_models.DdosProtectionPlan": + """Gets information about the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosProtectionPlan, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: "_models.DdosProtectionPlan", + **kwargs + ) -> "_models.DdosProtectionPlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DdosProtectionPlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: "_models.DdosProtectionPlan", + **kwargs + ) -> AsyncLROPoller["_models.DdosProtectionPlan"]: + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + ddos_protection_plan_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.DdosProtectionPlan": + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosProtectionPlan, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: + """Gets all DDoS protection plans in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DdosProtectionPlanListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DdosProtectionPlanListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DdosProtectionPlanListResult"]: + """Gets all the DDoS protection plans in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DdosProtectionPlanListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DdosProtectionPlanListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_default_security_rules_operations.py new file mode 100644 index 0000000000000..7db530d4fc9e4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_default_security_rules_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DefaultSecurityRulesOperations: + """DefaultSecurityRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + network_security_group_name: str, + **kwargs + ) -> AsyncIterable["_models.SecurityRuleListResult"]: + """Gets all default security rules in a network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_security_group_name: str, + default_security_rule_name: str, + **kwargs + ) -> "_models.SecurityRule": + """Get the specified default network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param default_security_rule_name: The name of the default security rule. + :type default_security_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'defaultSecurityRuleName': self._serialize.url("default_security_rule_name", default_security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_dscp_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_dscp_configuration_operations.py new file mode 100644 index 0000000000000..5ff7eee8b443c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_dscp_configuration_operations.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DscpConfigurationOperations: + """DscpConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: "_models.DscpConfiguration", + **kwargs + ) -> "_models.DscpConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DscpConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + dscp_configuration_name: str, + parameters: "_models.DscpConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.DscpConfiguration"]: + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.DscpConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DscpConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + dscp_configuration_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + dscp_configuration_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. + :type dscp_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + dscp_configuration_name: str, + **kwargs + ) -> "_models.DscpConfiguration": + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. + :type dscp_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscpConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DscpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DscpConfigurationListResult"]: + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DscpConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscpConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.DscpConfigurationListResult"]: + """Gets all dscp configurations in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DscpConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscpConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_authorizations_operations.py new file mode 100644 index 0000000000000..ec664301e4b9d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_authorizations_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitAuthorizationsOperations: + """ExpressRouteCircuitAuthorizationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + **kwargs + ) -> "_models.ExpressRouteCircuitAuthorization": + """Gets the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitAuthorization, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", + **kwargs + ) -> "_models.ExpressRouteCircuitAuthorization": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + authorization_name: str, + authorization_parameters: "_models.ExpressRouteCircuitAuthorization", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. + :type authorization_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + def list( + self, + resource_group_name: str, + circuit_name: str, + **kwargs + ) -> AsyncIterable["_models.AuthorizationListResult"]: + """Gets all authorizations in an express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AuthorizationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_connections_operations.py new file mode 100644 index 0000000000000..bd412cd17545e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_connections_operations.py @@ -0,0 +1,455 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitConnectionsOperations: + """ExpressRouteCircuitConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + **kwargs + ) -> "_models.ExpressRouteCircuitConnection": + """Gets the specified Express Route Circuit Connection from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", + **kwargs + ) -> "_models.ExpressRouteCircuitConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + express_route_circuit_connection_parameters: "_models.ExpressRouteCircuitConnection", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitConnection"]: + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. + :type express_route_circuit_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + express_route_circuit_connection_parameters=express_route_circuit_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCircuitConnectionListResult"]: + """Gets all global reach connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_peerings_operations.py new file mode 100644 index 0000000000000..51ab07aec1026 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuit_peerings_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitPeeringsOperations: + """ExpressRouteCircuitPeeringsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + **kwargs + ) -> "_models.ExpressRouteCircuitPeering": + """Gets the specified peering for the express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: "_models.ExpressRouteCircuitPeering", + **kwargs + ) -> "_models.ExpressRouteCircuitPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + peering_parameters: "_models.ExpressRouteCircuitPeering", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. + :type peering_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + def list( + self, + resource_group_name: str, + circuit_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: + """Gets all peerings in a specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitPeeringListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitPeeringListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuits_operations.py new file mode 100644 index 0000000000000..282ee7ec9af6c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_circuits_operations.py @@ -0,0 +1,1053 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitsOperations: + """ExpressRouteCircuitsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + circuit_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + circuit_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + circuit_name: str, + **kwargs + ) -> "_models.ExpressRouteCircuit": + """Gets information about the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuit, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + circuit_name: str, + parameters: "_models.ExpressRouteCircuit", + **kwargs + ) -> "_models.ExpressRouteCircuit": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + circuit_name: str, + parameters: "_models.ExpressRouteCircuit", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + circuit_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ExpressRouteCircuit": + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuit, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + async def _list_arp_table_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_arp_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_arp_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + async def begin_list_arp_table( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: + """Gets the currently advertised ARP table associated with the express route circuit in a resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_arp_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + async def _list_routes_table_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore + + async def begin_list_routes_table( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: + """Gets the currently advertised routes table associated with the express route circuit in a + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_routes_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore + + async def _list_routes_table_summary_initial( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_summary_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_summary_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + async def begin_list_routes_table_summary( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + """Gets the currently advertised routes table summary associated with the express route circuit in + a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + async def get_stats( + self, + resource_group_name: str, + circuit_name: str, + **kwargs + ) -> "_models.ExpressRouteCircuitStats": + """Gets all the stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitStats, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_stats.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} # type: ignore + + async def get_peering_stats( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + **kwargs + ) -> "_models.ExpressRouteCircuitStats": + """Gets all stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitStats, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_peering_stats.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: + """Gets all the express route circuits in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: + """Gets all the express route circuits in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_connections_operations.py new file mode 100644 index 0000000000000..a0bfb04f1caa8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_connections_operations.py @@ -0,0 +1,414 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteConnectionsOperations: + """ExpressRouteConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: "_models.ExpressRouteConnection", + **kwargs + ) -> "_models.ExpressRouteConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + put_express_route_connection_parameters: "_models.ExpressRouteConnection", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteConnection"]: + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. + :type put_express_route_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + put_express_route_connection_parameters=put_express_route_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + **kwargs + ) -> "_models.ExpressRouteConnection": + """Gets the specified ExpressRouteConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param connection_name: The name of the ExpressRoute connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + express_route_gateway_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a connection to a ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + async def list( + self, + resource_group_name: str, + express_route_gateway_name: str, + **kwargs + ) -> "_models.ExpressRouteConnectionList": + """Lists ExpressRouteConnections. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteConnectionList, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnectionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteConnectionList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py new file mode 100644 index 0000000000000..9179613ae04ee --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_cross_connection_peerings_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCrossConnectionPeeringsOperations: + """ExpressRouteCrossConnectionPeeringsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + cross_connection_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionPeeringList"]: + """Gets all peerings in a specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCrossConnectionPeeringList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeeringList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionPeeringList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + **kwargs + ) -> "_models.ExpressRouteCrossConnectionPeering": + """Gets the specified peering for the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCrossConnectionPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", + **kwargs + ) -> "_models.ExpressRouteCrossConnectionPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + peering_parameters: "_models.ExpressRouteCrossConnectionPeering", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionPeering"]: + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. + :type peering_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_cross_connections_operations.py new file mode 100644 index 0000000000000..4d0a80ba40238 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_cross_connections_operations.py @@ -0,0 +1,823 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCrossConnectionsOperations: + """ExpressRouteCrossConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: + """Retrieves all the ExpressRouteCrossConnections in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCrossConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteCrossConnectionListResult"]: + """Retrieves all the ExpressRouteCrossConnections in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCrossConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + cross_connection_name: str, + **kwargs + ) -> "_models.ExpressRouteCrossConnection": + """Gets details about the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group (peering location of the circuit). + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection (service key of the + circuit). + :type cross_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCrossConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: "_models.ExpressRouteCrossConnection", + **kwargs + ) -> "_models.ExpressRouteCrossConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + cross_connection_name: str, + parameters: "_models.ExpressRouteCrossConnection", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnection"]: + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + cross_connection_name: str, + cross_connection_parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ExpressRouteCrossConnection": + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. + :type cross_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCrossConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + async def _list_arp_table_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_arp_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_arp_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + async def begin_list_arp_table( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: + """Gets the currently advertised ARP table associated with the express route cross connection in a + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_arp_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + async def _list_routes_table_summary_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_summary_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCrossConnectionsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_summary_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + async def begin_list_routes_table_summary( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + """Gets the route table summary associated with the express route cross connection in a resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + async def _list_routes_table_initial( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore + + async def begin_list_routes_table( + self, + resource_group_name: str, + cross_connection_name: str, + peering_name: str, + device_path: str, + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: + """Gets the currently advertised routes table associated with the express route cross connection + in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_routes_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_gateways_operations.py new file mode 100644 index 0000000000000..4e907c22908ae --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_gateways_operations.py @@ -0,0 +1,443 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteGatewaysOperations: + """ExpressRouteGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_subscription( + self, + **kwargs + ) -> "_models.ExpressRouteGatewayList": + """Lists ExpressRoute gateways under a given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteGatewayList, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteGatewayList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways'} # type: ignore + + async def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> "_models.ExpressRouteGatewayList": + """Lists ExpressRoute gateways in a given resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteGatewayList, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteGatewayList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", + **kwargs + ) -> "_models.ExpressRouteGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_gateway_name: str, + put_express_route_gateway_parameters: "_models.ExpressRouteGateway", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRouteGateway"]: + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. + :type put_express_route_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + put_express_route_gateway_parameters=put_express_route_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + express_route_gateway_name: str, + **kwargs + ) -> "_models.ExpressRouteGateway": + """Fetches the details of a ExpressRoute gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + express_route_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + express_route_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway + resource can only be deleted when there are no connection subresources. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_links_operations.py new file mode 100644 index 0000000000000..2ae5abe8d0e52 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_links_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteLinksOperations: + """ExpressRouteLinksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + express_route_port_name: str, + link_name: str, + **kwargs + ) -> "_models.ExpressRouteLink": + """Retrieves the specified ExpressRouteLink resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :param link_name: The name of the ExpressRouteLink resource. + :type link_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteLink, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + 'linkName': self._serialize.url("link_name", link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}'} # type: ignore + + def list( + self, + resource_group_name: str, + express_route_port_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteLinkListResult"]: + """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteLinkListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_ports_locations_operations.py new file mode 100644 index 0000000000000..efbcbde7b366b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_ports_locations_operations.py @@ -0,0 +1,165 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRoutePortsLocationsOperations: + """ExpressRoutePortsLocationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ExpressRoutePortsLocationListResult"]: + """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each + location. Available bandwidths can only be obtained when retrieving a specific peering + location. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRoutePortsLocationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRoutePortsLocationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations'} # type: ignore + + async def get( + self, + location_name: str, + **kwargs + ) -> "_models.ExpressRoutePortsLocation": + """Retrieves a single ExpressRoutePort peering location, including the list of available + bandwidths available at said peering location. + + :param location_name: Name of the requested ExpressRoutePort peering location. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRoutePortsLocation, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRoutePortsLocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_ports_operations.py new file mode 100644 index 0000000000000..3ac55be91b9df --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_ports_operations.py @@ -0,0 +1,606 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRoutePortsOperations: + """ExpressRoutePortsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + express_route_port_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + express_route_port_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + express_route_port_name: str, + **kwargs + ) -> "_models.ExpressRoutePort": + """Retrieves the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. + :type express_route_port_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRoutePort, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: "_models.ExpressRoutePort", + **kwargs + ) -> "_models.ExpressRoutePort": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ExpressRoutePort') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: "_models.ExpressRoutePort", + **kwargs + ) -> AsyncLROPoller["_models.ExpressRoutePort"]: + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + express_route_port_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ExpressRoutePort": + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRoutePort, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: + """List all the ExpressRoutePort resources in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRoutePortListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRoutePortListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ExpressRoutePortListResult"]: + """List all the ExpressRoutePort resources in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRoutePortListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRoutePortListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts'} # type: ignore + + async def generate_loa( + self, + resource_group_name: str, + express_route_port_name: str, + request: "_models.GenerateExpressRoutePortsLOARequest", + **kwargs + ) -> "_models.GenerateExpressRoutePortsLOAResult": + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. + :type request: ~azure.mgmt.network.v2020_07_01.models.GenerateExpressRoutePortsLOARequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateExpressRoutePortsLOAResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.GenerateExpressRoutePortsLOAResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateExpressRoutePortsLOAResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.generate_loa.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'GenerateExpressRoutePortsLOARequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateExpressRoutePortsLOAResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_loa.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_service_providers_operations.py new file mode 100644 index 0000000000000..3ac639fbabd53 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_service_providers_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteServiceProvidersOperations: + """ExpressRouteServiceProvidersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: + """Gets all the available express route service providers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteServiceProviderListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteServiceProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteServiceProviderListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_firewall_policies_operations.py new file mode 100644 index 0000000000000..89ef7e25ac9b7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_firewall_policies_operations.py @@ -0,0 +1,479 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FirewallPoliciesOperations: + """FirewallPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + firewall_policy_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + firewall_policy_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.FirewallPolicy": + """Gets the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FirewallPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: "_models.FirewallPolicy", + **kwargs + ) -> "_models.FirewallPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FirewallPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + parameters: "_models.FirewallPolicy", + **kwargs + ) -> AsyncLROPoller["_models.FirewallPolicy"]: + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: + """Lists all Firewall Policies in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.FirewallPolicyListResult"]: + """Gets all the Firewall Policies in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py new file mode 100644 index 0000000000000..1fcc8775732aa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_firewall_policy_rule_collection_groups_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FirewallPolicyRuleCollectionGroupsOperations: + """FirewallPolicyRuleCollectionGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. + :type rule_collection_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + **kwargs + ) -> "_models.FirewallPolicyRuleCollectionGroup": + """Gets the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. + :type rule_collection_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FirewallPolicyRuleCollectionGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: "_models.FirewallPolicyRuleCollectionGroup", + **kwargs + ) -> "_models.FirewallPolicyRuleCollectionGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FirewallPolicyRuleCollectionGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + firewall_policy_name: str, + rule_collection_group_name: str, + parameters: "_models.FirewallPolicyRuleCollectionGroup", + **kwargs + ) -> AsyncLROPoller["_models.FirewallPolicyRuleCollectionGroup"]: + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleCollectionGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + def list( + self, + resource_group_name: str, + firewall_policy_name: str, + **kwargs + ) -> AsyncIterable["_models.FirewallPolicyRuleCollectionGroupListResult"]: + """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FirewallPolicyRuleCollectionGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_flow_logs_operations.py new file mode 100644 index 0000000000000..832ca015ba6e7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_flow_logs_operations.py @@ -0,0 +1,505 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FlowLogsOperations: + """FlowLogsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: "_models.FlowLog", + **kwargs + ) -> "_models.FlowLog": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FlowLog') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FlowLog', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: "_models.FlowLog", + **kwargs + ) -> AsyncLROPoller["_models.FlowLog"]: + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FlowLog + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.FlowLog": + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FlowLog, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + **kwargs + ) -> "_models.FlowLog": + """Gets a flow log resource by name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. + :type flow_log_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FlowLog, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_watcher_name: str, + flow_log_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified flow log resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. + :type flow_log_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def list( + self, + resource_group_name: str, + network_watcher_name: str, + **kwargs + ) -> AsyncIterable["_models.FlowLogListResult"]: + """Lists all flow log resources for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FlowLogListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.FlowLogListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FlowLogListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_hub_route_tables_operations.py new file mode 100644 index 0000000000000..6a895c5d36f9d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_hub_route_tables_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HubRouteTablesOperations: + """HubRouteTablesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: "_models.HubRouteTable", + **kwargs + ) -> "_models.HubRouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_table_parameters, 'HubRouteTable') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + route_table_parameters: "_models.HubRouteTable", + **kwargs + ) -> AsyncLROPoller["_models.HubRouteTable"]: + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. + :type route_table_parameters: ~azure.mgmt.network.v2020_07_01.models.HubRouteTable + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either HubRouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + route_table_parameters=route_table_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + **kwargs + ) -> "_models.HubRouteTable": + """Retrieves the details of a RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HubRouteTable, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.HubRouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a RouteTable. + + :param resource_group_name: The resource group name of the RouteTable. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> AsyncIterable["_models.ListHubRouteTablesResult"]: + """Retrieves the details of all RouteTables. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListHubRouteTablesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListHubRouteTablesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListHubRouteTablesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_hub_virtual_network_connections_operations.py new file mode 100644 index 0000000000000..1e5dae4ac5550 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_hub_virtual_network_connections_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HubVirtualNetworkConnectionsOperations: + """HubVirtualNetworkConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: "_models.HubVirtualNetworkConnection", + **kwargs + ) -> "_models.HubVirtualNetworkConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hub_virtual_network_connection_parameters, 'HubVirtualNetworkConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + hub_virtual_network_connection_parameters: "_models.HubVirtualNetworkConnection", + **kwargs + ) -> AsyncLROPoller["_models.HubVirtualNetworkConnection"]: + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. + :type hub_virtual_network_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either HubVirtualNetworkConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + hub_virtual_network_connection_parameters=hub_virtual_network_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + **kwargs + ) -> "_models.HubVirtualNetworkConnection": + """Retrieves the details of a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HubVirtualNetworkConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> AsyncIterable["_models.ListHubVirtualNetworkConnectionsResult"]: + """Retrieves the details of all HubVirtualNetworkConnections. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListHubVirtualNetworkConnectionsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListHubVirtualNetworkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListHubVirtualNetworkConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_inbound_nat_rules_operations.py new file mode 100644 index 0000000000000..d5b102470d987 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_inbound_nat_rules_operations.py @@ -0,0 +1,436 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class InboundNatRulesOperations: + """InboundNatRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.InboundNatRuleListResult"]: + """Gets all the inbound nat rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundNatRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.InboundNatRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('InboundNatRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.InboundNatRule": + """Gets the specified load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InboundNatRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.InboundNatRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: "_models.InboundNatRule", + **kwargs + ) -> "_models.InboundNatRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + inbound_nat_rule_name: str, + inbound_nat_rule_parameters: "_models.InboundNatRule", + **kwargs + ) -> AsyncLROPoller["_models.InboundNatRule"]: + """Creates or updates a load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound nat + rule operation. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2020_07_01.models.InboundNatRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + inbound_nat_rule_parameters=inbound_nat_rule_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_inbound_security_rule_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_inbound_security_rule_operations.py new file mode 100644 index 0000000000000..a42ee15d23cea --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_inbound_security_rule_operations.py @@ -0,0 +1,179 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class InboundSecurityRuleOperations: + """InboundSecurityRuleOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: "_models.InboundSecurityRule", + **kwargs + ) -> "_models.InboundSecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'ruleCollectionName': self._serialize.url("rule_collection_name", rule_collection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'InboundSecurityRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('InboundSecurityRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('InboundSecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + rule_collection_name: str, + parameters: "_models.InboundSecurityRule", + **kwargs + ) -> AsyncLROPoller["_models.InboundSecurityRule"]: + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.InboundSecurityRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either InboundSecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundSecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'ruleCollectionName': self._serialize.url("rule_collection_name", rule_collection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ip_allocations_operations.py new file mode 100644 index 0000000000000..58da931cbc380 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ip_allocations_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IpAllocationsOperations: + """IpAllocationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + ip_allocation_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + ip_allocation_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified IpAllocation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + ip_allocation_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.IpAllocation": + """Gets the specified IpAllocation by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpAllocation, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: "_models.IpAllocation", + **kwargs + ) -> "_models.IpAllocation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'IpAllocation') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: "_models.IpAllocation", + **kwargs + ) -> AsyncLROPoller["_models.IpAllocation"]: + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.IpAllocation + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + ip_allocation_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.IpAllocation": + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpAllocation, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.IpAllocationListResult"]: + """Gets all IpAllocations in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpAllocationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IpAllocationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.IpAllocationListResult"]: + """Gets all IpAllocations in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpAllocationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IpAllocationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ip_groups_operations.py new file mode 100644 index 0000000000000..9e1d3c5fb6e4a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_ip_groups_operations.py @@ -0,0 +1,552 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IpGroupsOperations: + """IpGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + ip_groups_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.IpGroup": + """Gets the specified ipGroups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :param expand: Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced + by the IpGroups resource. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: "_models.IpGroup", + **kwargs + ) -> "_models.IpGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'IpGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('IpGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: "_models.IpGroup", + **kwargs + ) -> AsyncLROPoller["_models.IpGroup"]: + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.IpGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + async def update_groups( + self, + resource_group_name: str, + ip_groups_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.IpGroup": + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_groups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + ip_groups_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + ip_groups_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified ipGroups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.IpGroupListResult"]: + """Gets all IpGroups in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IpGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.IpGroupListResult"]: + """Gets all IpGroups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IpGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py new file mode 100644 index 0000000000000..3c4886aeb5bf9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_backend_address_pools_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerBackendAddressPoolsOperations: + """LoadBalancerBackendAddressPoolsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: + """Gets all the load balancer backed address pools. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerBackendAddressPoolListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerBackendAddressPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerBackendAddressPoolListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + **kwargs + ) -> "_models.BackendAddressPool": + """Gets load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. + :type backend_address_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackendAddressPool, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.BackendAddressPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: "_models.BackendAddressPool", + **kwargs + ) -> "_models.BackendAddressPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackendAddressPool') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + parameters: "_models.BackendAddressPool", + **kwargs + ) -> AsyncLROPoller["_models.BackendAddressPool"]: + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.BackendAddressPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BackendAddressPool or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + load_balancer_name: str, + backend_address_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. + :type backend_address_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py new file mode 100644 index 0000000000000..e844e51cb98c0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerFrontendIPConfigurationsOperations: + """LoadBalancerFrontendIPConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: + """Gets all the load balancer frontend IP configurations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerFrontendIPConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerFrontendIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerFrontendIPConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + frontend_ip_configuration_name: str, + **kwargs + ) -> "_models.FrontendIPConfiguration": + """Gets load balancer frontend IP configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param frontend_ip_configuration_name: The name of the frontend IP configuration. + :type frontend_ip_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FrontendIPConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'frontendIPConfigurationName': self._serialize.url("frontend_ip_configuration_name", frontend_ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FrontendIPConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py new file mode 100644 index 0000000000000..39151ff818074 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_load_balancing_rules_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerLoadBalancingRulesOperations: + """LoadBalancerLoadBalancingRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: + """Gets all the load balancing rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerLoadBalancingRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerLoadBalancingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerLoadBalancingRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + load_balancing_rule_name: str, + **kwargs + ) -> "_models.LoadBalancingRule": + """Gets the specified load balancer load balancing rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param load_balancing_rule_name: The name of the load balancing rule. + :type load_balancing_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LoadBalancingRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LoadBalancingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'loadBalancingRuleName': self._serialize.url("load_balancing_rule_name", load_balancing_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LoadBalancingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_network_interfaces_operations.py new file mode 100644 index 0000000000000..799bfb09b6308 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_network_interfaces_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerNetworkInterfacesOperations: + """LoadBalancerNetworkInterfacesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: + """Gets associated load balancer network interfaces. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_outbound_rules_operations.py new file mode 100644 index 0000000000000..2ba143410e3d2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_outbound_rules_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerOutboundRulesOperations: + """LoadBalancerOutboundRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerOutboundRuleListResult"]: + """Gets all the outbound rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerOutboundRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerOutboundRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerOutboundRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + outbound_rule_name: str, + **kwargs + ) -> "_models.OutboundRule": + """Gets the specified load balancer outbound rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param outbound_rule_name: The name of the outbound rule. + :type outbound_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OutboundRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.OutboundRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'outboundRuleName': self._serialize.url("outbound_rule_name", outbound_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OutboundRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_probes_operations.py new file mode 100644 index 0000000000000..d0be10b2e314b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancer_probes_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerProbesOperations: + """LoadBalancerProbesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: + """Gets all the load balancer probes. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerProbeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerProbeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerProbeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + probe_name: str, + **kwargs + ) -> "_models.Probe": + """Gets load balancer probe. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param probe_name: The name of the probe. + :type probe_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Probe, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Probe + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'probeName': self._serialize.url("probe_name", probe_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Probe', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancers_operations.py new file mode 100644 index 0000000000000..1e6da7f584277 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_load_balancers_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancersOperations: + """LoadBalancersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + load_balancer_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + load_balancer_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.LoadBalancer": + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LoadBalancer, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: "_models.LoadBalancer", + **kwargs + ) -> "_models.LoadBalancer": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LoadBalancer') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: "_models.LoadBalancer", + **kwargs + ) -> AsyncLROPoller["_models.LoadBalancer"]: + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.LoadBalancer + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + load_balancer_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.LoadBalancer": + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LoadBalancer, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerListResult"]: + """Gets all the load balancers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.LoadBalancerListResult"]: + """Gets all the load balancers in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_local_network_gateways_operations.py new file mode 100644 index 0000000000000..0670bbb56c247 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_local_network_gateways_operations.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LocalNetworkGatewaysOperations: + """LocalNetworkGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: "_models.LocalNetworkGateway", + **kwargs + ) -> "_models.LocalNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LocalNetworkGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: "_models.LocalNetworkGateway", + **kwargs + ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + local_network_gateway_name: str, + **kwargs + ) -> "_models.LocalNetworkGateway": + """Gets the specified local network gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LocalNetworkGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + local_network_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + local_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified local network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + local_network_gateway_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.LocalNetworkGateway": + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LocalNetworkGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: + """Gets all the local network gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LocalNetworkGatewayListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.LocalNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LocalNetworkGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_nat_gateways_operations.py new file mode 100644 index 0000000000000..35d8e182882a0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_nat_gateways_operations.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NatGatewaysOperations: + """NatGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + nat_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + nat_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified nat gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + nat_gateway_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NatGateway": + """Gets the specified nat gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NatGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: "_models.NatGateway", + **kwargs + ) -> Optional["_models.NatGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NatGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NatGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NatGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: "_models.NatGateway", + **kwargs + ) -> AsyncLROPoller["_models.NatGateway"]: + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NatGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + nat_gateway_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.NatGateway": + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NatGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.NatGatewayListResult"]: + """Gets all the Nat Gateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NatGatewayListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NatGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.NatGatewayListResult"]: + """Gets all nat gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NatGatewayListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NatGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_ip_configurations_operations.py new file mode 100644 index 0000000000000..daf9ae179047d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_ip_configurations_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfaceIPConfigurationsOperations: + """NetworkInterfaceIPConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: + """Get all ip configurations in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceIPConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceIPConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs + ) -> "_models.NetworkInterfaceIPConfiguration": + """Gets the specified network interface ip configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration name. + :type ip_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterfaceIPConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterfaceIPConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_load_balancers_operations.py new file mode 100644 index 0000000000000..0b663f7c2e763 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_load_balancers_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfaceLoadBalancersOperations: + """NetworkInterfaceLoadBalancersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: + """List all load balancers in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceLoadBalancerListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceLoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceLoadBalancerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_tap_configurations_operations.py new file mode 100644 index 0000000000000..f99848a5b4180 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interface_tap_configurations_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfaceTapConfigurationsOperations: + """NetworkInterfaceTapConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified tap configuration from the NetworkInterface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. + :type tap_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + **kwargs + ) -> "_models.NetworkInterfaceTapConfiguration": + """Get the specified tap configuration on a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. + :type tap_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterfaceTapConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", + **kwargs + ) -> "_models.NetworkInterfaceTapConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + tap_configuration_name: str, + tap_configuration_parameters: "_models.NetworkInterfaceTapConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.NetworkInterfaceTapConfiguration"]: + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. + :type tap_configuration_parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + tap_configuration_parameters=tap_configuration_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceTapConfigurationListResult"]: + """Get all Tap configurations in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceTapConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceTapConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interfaces_operations.py new file mode 100644 index 0000000000000..92464f85d09a2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_interfaces_operations.py @@ -0,0 +1,1163 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfacesOperations: + """NetworkInterfacesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_interface_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NetworkInterface": + """Gets information about the specified network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterface, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_interface_name: str, + parameters: "_models.NetworkInterface", + **kwargs + ) -> "_models.NetworkInterface": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkInterface') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + parameters: "_models.NetworkInterface", + **kwargs + ) -> AsyncLROPoller["_models.NetworkInterface"]: + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_interface_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.NetworkInterface": + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterface, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: + """Gets all network interfaces in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: + """Gets all network interfaces in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} # type: ignore + + async def _get_effective_route_table_initial( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> Optional["_models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_effective_route_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_effective_route_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore + + async def begin_get_effective_route_table( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: + """Gets all route tables applied to a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.EffectiveRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_effective_route_table_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore + + async def _list_effective_network_security_groups_initial( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_effective_network_security_groups_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_effective_network_security_groups_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore + + async def begin_list_effective_network_security_groups( + self, + resource_group_name: str, + network_interface_name: str, + **kwargs + ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: + """Gets all network security groups applied to a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityGroupListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_effective_network_security_groups_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore + + def list_virtual_machine_scale_set_vm_network_interfaces( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: + """Gets information about all network interfaces in a virtual machine in a virtual machine scale + set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} # type: ignore + + def list_virtual_machine_scale_set_network_interfaces( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: + """Gets all network interfaces in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} # type: ignore + + async def get_virtual_machine_scale_set_network_interface( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NetworkInterface": + """Get the specified network interface in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterface, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + # Construct URL + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def list_virtual_machine_scale_set_ip_configurations( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceIPConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceIPConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_ip_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'} # type: ignore + + async def get_virtual_machine_scale_set_ip_configuration( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NetworkInterfaceIPConfiguration": + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration. + :type ip_configuration_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterfaceIPConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + # Construct URL + url = self.get_virtual_machine_scale_set_ip_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterfaceIPConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_virtual_machine_scale_set_ip_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_management_client_operations.py new file mode 100644 index 0000000000000..8d56c17be16ba --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_management_client_operations.py @@ -0,0 +1,917 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkManagementClientOperationsMixin: + + async def _put_bastion_shareable_link_initial( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: "_models.BastionShareableLinkListRequest", + **kwargs + ) -> Optional["_models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._put_bastion_shareable_link_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_bastion_shareable_link_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks'} # type: ignore + + async def begin_put_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: "_models.BastionShareableLinkListRequest", + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionShareableLinkListResult"]]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param bsl_request: Post request for all the Bastion Shareable Link endpoints. + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.put_bastion_shareable_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_bastion_shareable_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks'} # type: ignore + + async def _delete_bastion_shareable_link_initial( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: "_models.BastionShareableLinkListRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._delete_bastion_shareable_link_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_bastion_shareable_link_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks'} # type: ignore + + async def begin_delete_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: "_models.BastionShareableLinkListRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param bsl_request: Post request for all the Bastion Shareable Link endpoints. + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_bastion_shareable_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks'} # type: ignore + + def get_bastion_shareable_link( + self, + resource_group_name: str, + bastion_host_name: str, + bsl_request: "_models.BastionShareableLinkListRequest", + **kwargs + ) -> AsyncIterable["_models.BastionShareableLinkListResult"]: + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param bsl_request: Post request for all the Bastion Shareable Link endpoints. + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_bastion_shareable_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_bastion_shareable_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks'} # type: ignore + + async def _get_active_sessions_initial( + self, + resource_group_name: str, + bastion_host_name: str, + **kwargs + ) -> Optional["_models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_active_sessions_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_active_sessions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions'} # type: ignore + + async def begin_get_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + **kwargs + ) -> AsyncLROPoller[AsyncItemPaged["_models.BastionActiveSessionListResult"]]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_active_sessions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_active_sessions_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_active_sessions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions'} # type: ignore + + def disconnect_active_sessions( + self, + resource_group_name: str, + bastion_host_name: str, + session_ids: "_models.SessionIds", + **kwargs + ) -> AsyncIterable["_models.BastionSessionDeleteResult"]: + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. + :type session_ids: ~azure.mgmt.network.v2020_07_01.models.SessionIds + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionSessionDeleteResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.disconnect_active_sessions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(session_ids, 'SessionIds') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(session_ids, 'SessionIds') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BastionSessionDeleteResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + disconnect_active_sessions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions'} # type: ignore + + async def check_dns_name_availability( + self, + location: str, + domain_name_label: str, + **kwargs + ) -> "_models.DnsNameAvailabilityResult": + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + + :param location: The location of the domain name. + :type location: str + :param domain_name_label: The domain name to be verified. It must conform to the following + regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + :type domain_name_label: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DnsNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DnsNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.check_dns_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DnsNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} # type: ignore + + async def supported_security_providers( + self, + resource_group_name: str, + virtual_wan_name: str, + **kwargs + ) -> "_models.VirtualWanSecurityProviders": + """Gives the supported security providers for the virtual wan. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which supported security providers are + needed. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualWanSecurityProviders, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviders + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.supported_security_providers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + supported_security_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders'} # type: ignore + + async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: "_models.VirtualWanVpnProfileParameters", + **kwargs + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generatevirtualwanvpnserverconfigurationvpnprofile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generatevirtualwanvpnserverconfigurationvpnprofile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile'} # type: ignore + + async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( + self, + resource_group_name: str, + virtual_wan_name: str, + vpn_client_params: "_models.VirtualWanVpnProfileParameters", + **kwargs + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. + :type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._generatevirtualwanvpnserverconfigurationvpnprofile_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + vpn_client_params=vpn_client_params, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generatevirtualwanvpnserverconfigurationvpnprofile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_profiles_operations.py new file mode 100644 index 0000000000000..d7cbcb18b60c1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_profiles_operations.py @@ -0,0 +1,487 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkProfilesOperations: + """NetworkProfilesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_profile_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_profile_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified network profile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the NetworkProfile. + :type network_profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_profile_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NetworkProfile": + """Gets the specified network profile in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the public IP prefix. + :type network_profile_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + network_profile_name: str, + parameters: "_models.NetworkProfile", + **kwargs + ) -> "_models.NetworkProfile": + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_profile_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.NetworkProfile": + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.NetworkProfileListResult"]: + """Gets all the network profiles in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkProfileListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkProfileListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkProfileListResult"]: + """Gets all network profiles in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkProfileListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkProfileListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_security_groups_operations.py new file mode 100644 index 0000000000000..46e60c0f22db2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_security_groups_operations.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkSecurityGroupsOperations: + """NetworkSecurityGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_security_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_security_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_security_group_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NetworkSecurityGroup": + """Gets the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: "_models.NetworkSecurityGroup", + **kwargs + ) -> "_models.NetworkSecurityGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: "_models.NetworkSecurityGroup", + **kwargs + ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_security_group_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.NetworkSecurityGroup": + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: + """Gets all network security groups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: + """Gets all network security groups in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_virtual_appliances_operations.py new file mode 100644 index 0000000000000..387a351745363 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_virtual_appliances_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkVirtualAppliancesOperations: + """NetworkVirtualAppliancesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. + :type network_virtual_appliance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.NetworkVirtualAppliance": + """Gets the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkVirtualAppliance, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.NetworkVirtualAppliance": + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkVirtualAppliance, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: "_models.NetworkVirtualAppliance", + **kwargs + ) -> "_models.NetworkVirtualAppliance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + parameters: "_models.NetworkVirtualAppliance", + **kwargs + ) -> AsyncLROPoller["_models.NetworkVirtualAppliance"]: + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: + """Lists all Network Virtual Appliances in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.NetworkVirtualApplianceListResult"]: + """Gets all Network Virtual Appliances in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_watchers_operations.py new file mode 100644 index 0000000000000..8ba90ca5cd2d7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_network_watchers_operations.py @@ -0,0 +1,1983 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkWatchersOperations: + """NetworkWatchersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.NetworkWatcher", + **kwargs + ) -> "_models.NetworkWatcher": + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkWatcher, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkWatcher') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_watcher_name: str, + **kwargs + ) -> "_models.NetworkWatcher": + """Gets the specified network watcher by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkWatcher, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + network_watcher_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_watcher_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified network watcher resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.NetworkWatcher": + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkWatcher, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: + """Gets all network watchers by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.NetworkWatcherListResult"]: + """Gets all network watchers by subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} # type: ignore + + async def get_topology( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.TopologyParameters", + **kwargs + ) -> "_models.Topology": + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TopologyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Topology, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Topology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.get_topology.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TopologyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Topology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} # type: ignore + + async def _verify_ip_flow_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.VerificationIPFlowParameters", + **kwargs + ) -> "_models.VerificationIPFlowResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._verify_ip_flow_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _verify_ip_flow_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore + + async def begin_verify_ip_flow( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.VerificationIPFlowParameters", + **kwargs + ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VerificationIPFlowParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._verify_ip_flow_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore + + async def _get_next_hop_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.NextHopParameters", + **kwargs + ) -> "_models.NextHopResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_next_hop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NextHopParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NextHopResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('NextHopResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_next_hop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore + + async def begin_get_next_hop( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.NextHopParameters", + **kwargs + ) -> AsyncLROPoller["_models.NextHopResult"]: + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NextHopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_next_hop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NextHopResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore + + async def _get_vm_security_rules_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.SecurityGroupViewParameters", + **kwargs + ) -> "_models.SecurityGroupViewResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_vm_security_rules_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vm_security_rules_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore + + async def begin_get_vm_security_rules( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.SecurityGroupViewParameters", + **kwargs + ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.SecurityGroupViewParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_vm_security_rules_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore + + async def _get_troubleshooting_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.TroubleshootingParameters", + **kwargs + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_troubleshooting_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TroubleshootingParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_troubleshooting_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore + + async def begin_get_troubleshooting( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.TroubleshootingParameters", + **kwargs + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TroubleshootingParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_troubleshooting_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore + + async def _get_troubleshooting_result_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.QueryTroubleshootingParameters", + **kwargs + ) -> "_models.TroubleshootingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_troubleshooting_result_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_troubleshooting_result_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore + + async def begin_get_troubleshooting_result( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.QueryTroubleshootingParameters", + **kwargs + ) -> AsyncLROPoller["_models.TroubleshootingResult"]: + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.QueryTroubleshootingParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_troubleshooting_result_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore + + async def _set_flow_log_configuration_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.FlowLogInformation", + **kwargs + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._set_flow_log_configuration_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FlowLogInformation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _set_flow_log_configuration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore + + async def begin_set_flow_log_configuration( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.FlowLogInformation", + **kwargs + ) -> AsyncLROPoller["_models.FlowLogInformation"]: + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FlowLogInformation + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._set_flow_log_configuration_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore + + async def _get_flow_log_status_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.FlowLogStatusParameters", + **kwargs + ) -> "_models.FlowLogInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_flow_log_status_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_flow_log_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore + + async def begin_get_flow_log_status( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.FlowLogStatusParameters", + **kwargs + ) -> AsyncLROPoller["_models.FlowLogInformation"]: + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FlowLogStatusParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_flow_log_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore + + async def _check_connectivity_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.ConnectivityParameters", + **kwargs + ) -> "_models.ConnectivityInformation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._check_connectivity_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectivityParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectivityInformation', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ConnectivityInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _check_connectivity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore + + async def begin_check_connectivity( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.ConnectivityParameters", + **kwargs + ) -> AsyncLROPoller["_models.ConnectivityInformation"]: + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectivityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._check_connectivity_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectivityInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore + + async def _get_azure_reachability_report_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.AzureReachabilityReportParameters", + **kwargs + ) -> "_models.AzureReachabilityReport": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_azure_reachability_report_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_azure_reachability_report_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} # type: ignore + + async def begin_get_azure_reachability_report( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.AzureReachabilityReportParameters", + **kwargs + ) -> AsyncLROPoller["_models.AzureReachabilityReport"]: + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_azure_reachability_report_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_azure_reachability_report.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} # type: ignore + + async def _list_available_providers_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.AvailableProvidersListParameters", + **kwargs + ) -> "_models.AvailableProvidersList": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._list_available_providers_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AvailableProvidersList', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AvailableProvidersList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_available_providers_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} # type: ignore + + async def begin_list_available_providers( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.AvailableProvidersListParameters", + **kwargs + ) -> AsyncLROPoller["_models.AvailableProvidersList"]: + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_available_providers_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AvailableProvidersList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} # type: ignore + + async def _get_network_configuration_diagnostic_initial( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.NetworkConfigurationDiagnosticParameters", + **kwargs + ) -> "_models.NetworkConfigurationDiagnosticResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_network_configuration_diagnostic_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_network_configuration_diagnostic_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'} # type: ignore + + async def begin_get_network_configuration_diagnostic( + self, + resource_group_name: str, + network_watcher_name: str, + parameters: "_models.NetworkConfigurationDiagnosticParameters", + **kwargs + ) -> AsyncLROPoller["_models.NetworkConfigurationDiagnosticResponse"]: + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_network_configuration_diagnostic_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_network_configuration_diagnostic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_operations.py new file mode 100644 index 0000000000000..cf6a9219ea797 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available Network Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Network/operations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_p2_svpn_gateways_operations.py new file mode 100644 index 0000000000000..95ed60e919d81 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_p2_svpn_gateways_operations.py @@ -0,0 +1,1208 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class P2SVpnGatewaysOperations: + """P2SVpnGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> "_models.P2SVpnGateway": + """Retrieves the details of a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: P2SVpnGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", + **kwargs + ) -> "_models.P2SVpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: "_models.P2SVpnGateway", + **kwargs + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: "_models.TagsObject", + **kwargs + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: "_models.TagsObject", + **kwargs + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: + """Lists all the P2SVpnGateways in a resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListP2SVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListP2SVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ListP2SVpnGatewaysResult"]: + """Lists all the P2SVpnGateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListP2SVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListP2SVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways'} # type: ignore + + async def _reset_initial( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset'} # type: ignore + + async def begin_reset( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: + """Resets the primary of the p2s vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset'} # type: ignore + + async def _generate_vpn_profile_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: "_models.P2SVpnProfileParameters", + **kwargs + ) -> Optional["_models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generate_vpn_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generate_vpn_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile'} # type: ignore + + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + gateway_name: str, + parameters: "_models.P2SVpnProfileParameters", + **kwargs + ) -> AsyncLROPoller["_models.VpnProfileResponse"]: + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.P2SVpnProfileParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile'} # type: ignore + + async def _get_p2_s_vpn_connection_health_initial( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> Optional["_models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_p2_s_vpn_connection_health_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_p2_s_vpn_connection_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth'} # type: ignore + + async def begin_get_p2_s_vpn_connection_health( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> AsyncLROPoller["_models.P2SVpnGateway"]: + """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_p2_s_vpn_connection_health_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_p2_s_vpn_connection_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth'} # type: ignore + + async def _get_p2_s_vpn_connection_health_detailed_initial( + self, + resource_group_name: str, + gateway_name: str, + request: "_models.P2SVpnConnectionHealthRequest", + **kwargs + ) -> Optional["_models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_p2_s_vpn_connection_health_detailed_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnConnectionHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_p2_s_vpn_connection_health_detailed_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed'} # type: ignore + + async def begin_get_p2_s_vpn_connection_health_detailed( + self, + resource_group_name: str, + gateway_name: str, + request: "_models.P2SVpnConnectionHealthRequest", + **kwargs + ) -> AsyncLROPoller["_models.P2SVpnConnectionHealth"]: + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. + :type request: ~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionHealthRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_p2_s_vpn_connection_health_detailed_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnConnectionHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_p2_s_vpn_connection_health_detailed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed'} # type: ignore + + async def _disconnect_p2_s_vpn_connections_initial( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: "_models.P2SVpnConnectionRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._disconnect_p2_s_vpn_connections_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _disconnect_p2_s_vpn_connections_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections'} # type: ignore + + async def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name: str, + p2_s_vpn_gateway_name: str, + request: "_models.P2SVpnConnectionRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. + :type request: ~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._disconnect_p2_s_vpn_connections_initial( + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disconnect_p2_s_vpn_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_packet_captures_operations.py new file mode 100644 index 0000000000000..677479e0c56f8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_packet_captures_operations.py @@ -0,0 +1,672 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PacketCapturesOperations: + """PacketCapturesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: "_models.PacketCapture", + **kwargs + ) -> "_models.PacketCaptureResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PacketCapture') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PacketCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + parameters: "_models.PacketCapture", + **kwargs + ) -> AsyncLROPoller["_models.PacketCaptureResult"]: + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PacketCapture + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PacketCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> "_models.PacketCaptureResult": + """Gets a packet capture session by name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PacketCaptureResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PacketCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore + + async def begin_stop( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Stops a specified packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore + + async def _get_status_initial( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> "_models.PacketCaptureQueryStatusResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_status_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore + + async def begin_get_status( + self, + resource_group_name: str, + network_watcher_name: str, + packet_capture_name: str, + **kwargs + ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: + """Query the status of a running packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param packet_capture_name: The name given to the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PacketCaptureQueryStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore + + def list( + self, + resource_group_name: str, + network_watcher_name: str, + **kwargs + ) -> AsyncIterable["_models.PacketCaptureListResult"]: + """Lists all packet capture sessions within the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PacketCaptureListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PacketCaptureListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PacketCaptureListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py new file mode 100644 index 0000000000000..bcc3ca0b874d8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_peer_express_route_circuit_connections_operations.py @@ -0,0 +1,188 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PeerExpressRouteCircuitConnectionsOperations: + """PeerExpressRouteCircuitConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + connection_name: str, + **kwargs + ) -> "_models.PeerExpressRouteCircuitConnection": + """Gets the specified Peer Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the peer express route circuit connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PeerExpressRouteCircuitConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PeerExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + circuit_name: str, + peering_name: str, + **kwargs + ) -> AsyncIterable["_models.PeerExpressRouteCircuitConnectionListResult"]: + """Gets all global reach peer connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PeerExpressRouteCircuitConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PeerExpressRouteCircuitConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_dns_zone_groups_operations.py new file mode 100644 index 0000000000000..edc6e35b3e2ed --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_dns_zone_groups_operations.py @@ -0,0 +1,432 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateDnsZoneGroupsOperations: + """PrivateDnsZoneGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified private dns zone group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. + :type private_dns_zone_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + **kwargs + ) -> "_models.PrivateDnsZoneGroup": + """Gets the private dns zone group resource by specified private dns zone group name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. + :type private_dns_zone_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateDnsZoneGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: "_models.PrivateDnsZoneGroup", + **kwargs + ) -> "_models.PrivateDnsZoneGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateDnsZoneGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + private_dns_zone_group_name: str, + parameters: "_models.PrivateDnsZoneGroup", + **kwargs + ) -> AsyncLROPoller["_models.PrivateDnsZoneGroup"]: + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + def list( + self, + private_endpoint_name: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateDnsZoneGroupListResult"]: + """Gets all private dns zone groups in a private endpoint. + + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateDnsZoneGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateDnsZoneGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_endpoints_operations.py new file mode 100644 index 0000000000000..fbe821db6a0e6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_endpoints_operations.py @@ -0,0 +1,484 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointsOperations: + """PrivateEndpointsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + private_endpoint_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified private endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + private_endpoint_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.PrivateEndpoint": + """Gets the specified private endpoint by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: "_models.PrivateEndpoint", + **kwargs + ) -> "_models.PrivateEndpoint": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + private_endpoint_name: str, + parameters: "_models.PrivateEndpoint", + **kwargs + ) -> AsyncLROPoller["_models.PrivateEndpoint"]: + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: + """Gets all private endpoints in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.PrivateEndpointListResult"]: + """Gets all private endpoints in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_link_services_operations.py new file mode 100644 index 0000000000000..029ac09623971 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_private_link_services_operations.py @@ -0,0 +1,1207 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServicesOperations: + """PrivateLinkServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + service_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + service_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified private link service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + service_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.PrivateLinkService": + """Gets the specified private link service by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkService, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateLinkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + parameters: "_models.PrivateLinkService", + **kwargs + ) -> "_models.PrivateLinkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateLinkService') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + parameters: "_models.PrivateLinkService", + **kwargs + ) -> AsyncLROPoller["_models.PrivateLinkService"]: + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateLinkService + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: + """Gets all private link services in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkServiceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.PrivateLinkServiceListResult"]: + """Gets all private link service in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkServiceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices'} # type: ignore + + async def get_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Get the specific private end point connection by specific private link service in the resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. + :type pe_connection_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + async def update_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_initial( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + service_name: str, + pe_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. + :type pe_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + def list_private_endpoint_connections( + self, + resource_group_name: str, + service_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """Gets all private end point connections for a specific private link service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_private_endpoint_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore + + async def _check_private_link_service_visibility_initial( + self, + location: str, + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", + **kwargs + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._check_private_link_service_visibility_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + async def begin_check_private_link_service_visibility( + self, + location: str, + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", + **kwargs + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._check_private_link_service_visibility_initial( + location=location, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_private_link_service_visibility.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + async def _check_private_link_service_visibility_by_resource_group_initial( + self, + location: str, + resource_group_name: str, + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", + **kwargs + ) -> Optional["_models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._check_private_link_service_visibility_by_resource_group_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _check_private_link_service_visibility_by_resource_group_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + async def begin_check_private_link_service_visibility_by_resource_group( + self, + location: str, + resource_group_name: str, + parameters: "_models.CheckPrivateLinkServiceVisibilityRequest", + **kwargs + ) -> AsyncLROPoller["_models.PrivateLinkServiceVisibility"]: + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateLinkServiceVisibility or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._check_private_link_service_visibility_by_resource_group_initial( + location=location, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_private_link_service_visibility_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + def list_auto_approved_private_link_services( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoApprovedPrivateLinkServicesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AutoApprovedPrivateLinkServicesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_auto_approved_private_link_services.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices'} # type: ignore + + def list_auto_approved_private_link_services_by_resource_group( + self, + location: str, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AutoApprovedPrivateLinkServicesResult"]: + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoApprovedPrivateLinkServicesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AutoApprovedPrivateLinkServicesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_auto_approved_private_link_services_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_addresses_operations.py new file mode 100644 index 0000000000000..9fd68c0b9ac7f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_addresses_operations.py @@ -0,0 +1,785 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PublicIPAddressesOperations: + """PublicIPAddressesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + public_ip_address_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + public_ip_address_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified public IP address. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + public_ip_address_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.PublicIPAddress": + """Gets the specified public IP address in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPAddress, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: "_models.PublicIPAddress", + **kwargs + ) -> "_models.PublicIPAddress": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PublicIPAddress') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: "_models.PublicIPAddress", + **kwargs + ) -> AsyncLROPoller["_models.PublicIPAddress"]: + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + public_ip_address_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.PublicIPAddress": + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPAddress, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: + """Gets all the public IP addresses in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: + """Gets all public IP addresses in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore + + def list_virtual_machine_scale_set_public_ip_addresses( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + **kwargs + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: + """Gets information about all public IP addresses on a virtual machine scale set level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} # type: ignore + + def list_virtual_machine_scale_set_vm_public_ip_addresses( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + **kwargs + ) -> AsyncIterable["_models.PublicIPAddressListResult"]: + """Gets information about all public IP addresses in a virtual machine IP configuration in a + virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The network interface name. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. + :type ip_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} # type: ignore + + async def get_virtual_machine_scale_set_public_ip_address( + self, + resource_group_name: str, + virtual_machine_scale_set_name: str, + virtualmachine_index: str, + network_interface_name: str, + ip_configuration_name: str, + public_ip_address_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.PublicIPAddress": + """Get the specified public IP address in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. + :type public_ip_address_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPAddress, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + # Construct URL + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_prefixes_operations.py new file mode 100644 index 0000000000000..ba6db62429a68 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_prefixes_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PublicIPPrefixesOperations: + """PublicIPPrefixesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + public_ip_prefix_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + public_ip_prefix_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified public IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIpPrefix. + :type public_ip_prefix_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + public_ip_prefix_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.PublicIPPrefix": + """Gets the specified public IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: "_models.PublicIPPrefix", + **kwargs + ) -> "_models.PublicIPPrefix": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PublicIPPrefix') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: "_models.PublicIPPrefix", + **kwargs + ) -> AsyncLROPoller["_models.PublicIPPrefix"]: + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + public_ip_prefix_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.PublicIPPrefix": + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: + """Gets all the public IP prefixes in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPPrefixListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.PublicIPPrefixListResult"]: + """Gets all public IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPPrefixListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_resource_navigation_links_operations.py new file mode 100644 index 0000000000000..5ae15c5a65ee8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_resource_navigation_links_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceNavigationLinksOperations: + """ResourceNavigationLinksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + **kwargs + ) -> "_models.ResourceNavigationLinksListResult": + """Gets a list of resource navigation links for a subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNavigationLinksListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ResourceNavigationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNavigationLinksListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_filter_rules_operations.py new file mode 100644 index 0000000000000..ba584cdcbb238 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_filter_rules_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RouteFilterRulesOperations: + """RouteFilterRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + **kwargs + ) -> "_models.RouteFilterRule": + """Gets the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteFilterRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteFilterRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: "_models.RouteFilterRule", + **kwargs + ) -> "_models.RouteFilterRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + rule_name: str, + route_filter_rule_parameters: "_models.RouteFilterRule", + **kwargs + ) -> AsyncLROPoller["_models.RouteFilterRule"]: + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. + :type route_filter_rule_parameters: ~azure.mgmt.network.v2020_07_01.models.RouteFilterRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + def list_by_route_filter( + self, + resource_group_name: str, + route_filter_name: str, + **kwargs + ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: + """Gets all RouteFilterRules in a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteFilterRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteFilterRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_route_filter.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteFilterRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_filters_operations.py new file mode 100644 index 0000000000000..327189705da4c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_filters_operations.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RouteFiltersOperations: + """RouteFiltersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + route_filter_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + route_filter_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + route_filter_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.RouteFilter": + """Gets the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param expand: Expands referenced express route bgp peering resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteFilter, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: "_models.RouteFilter", + **kwargs + ) -> "_models.RouteFilter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + route_filter_name: str, + route_filter_parameters: "_models.RouteFilter", + **kwargs + ) -> AsyncLROPoller["_models.RouteFilter"]: + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. + :type route_filter_parameters: ~azure.mgmt.network.v2020_07_01.models.RouteFilter + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + route_filter_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.RouteFilter": + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteFilter, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.RouteFilterListResult"]: + """Gets all route filters in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteFilterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.RouteFilterListResult"]: + """Gets all route filters in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteFilterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_tables_operations.py new file mode 100644 index 0000000000000..863562e3224d6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_route_tables_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RouteTablesOperations: + """RouteTablesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + route_table_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + route_table_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + route_table_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.RouteTable": + """Gets the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteTable, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + parameters: "_models.RouteTable", + **kwargs + ) -> "_models.RouteTable": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RouteTable') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RouteTable', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + parameters: "_models.RouteTable", + **kwargs + ) -> AsyncLROPoller["_models.RouteTable"]: + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + route_table_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.RouteTable": + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteTable, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.RouteTableListResult"]: + """Gets all route tables in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteTableListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteTableListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.RouteTableListResult"]: + """Gets all route tables in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteTableListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteTableListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_routes_operations.py new file mode 100644 index 0000000000000..469dadb81c90a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_routes_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RoutesOperations: + """RoutesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified route from a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + **kwargs + ) -> "_models.Route": + """Gets the specified route from a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Route, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: "_models.Route", + **kwargs + ) -> "_models.Route": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_parameters, 'Route') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Route', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + route_table_name: str, + route_name: str, + route_parameters: "_models.Route", + **kwargs + ) -> AsyncLROPoller["_models.Route"]: + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. + :type route_parameters: ~azure.mgmt.network.v2020_07_01.models.Route + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + route_parameters=route_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + def list( + self, + resource_group_name: str, + route_table_name: str, + **kwargs + ) -> AsyncIterable["_models.RouteListResult"]: + """Gets all routes in a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RouteListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_security_partner_providers_operations.py new file mode 100644 index 0000000000000..bb3f864983279 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_security_partner_providers_operations.py @@ -0,0 +1,541 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SecurityPartnerProvidersOperations: + """SecurityPartnerProvidersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + security_partner_provider_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + security_partner_provider_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + security_partner_provider_name: str, + **kwargs + ) -> "_models.SecurityPartnerProvider": + """Gets the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityPartnerProvider, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: "_models.SecurityPartnerProvider", + **kwargs + ) -> "_models.SecurityPartnerProvider": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SecurityPartnerProvider') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: "_models.SecurityPartnerProvider", + **kwargs + ) -> AsyncLROPoller["_models.SecurityPartnerProvider"]: + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + security_partner_provider_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.SecurityPartnerProvider": + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityPartnerProvider, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: + """Lists all Security Partner Providers in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityPartnerProviderListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityPartnerProviderListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.SecurityPartnerProviderListResult"]: + """Gets all the Security Partner Providers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityPartnerProviderListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityPartnerProviderListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_security_rules_operations.py new file mode 100644 index 0000000000000..086d617bc5e78 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_security_rules_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SecurityRulesOperations: + """SecurityRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + **kwargs + ) -> "_models.SecurityRule": + """Get the specified network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: "_models.SecurityRule", + **kwargs + ) -> "_models.SecurityRule": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_security_group_name: str, + security_rule_name: str, + security_rule_parameters: "_models.SecurityRule", + **kwargs + ) -> AsyncLROPoller["_models.SecurityRule"]: + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. + :type security_rule_parameters: ~azure.mgmt.network.v2020_07_01.models.SecurityRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + security_rule_parameters=security_rule_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + def list( + self, + resource_group_name: str, + network_security_group_name: str, + **kwargs + ) -> AsyncIterable["_models.SecurityRuleListResult"]: + """Gets all security rules in a network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_association_links_operations.py new file mode 100644 index 0000000000000..887396c5984f2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_association_links_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceAssociationLinksOperations: + """ServiceAssociationLinksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + **kwargs + ) -> "_models.ServiceAssociationLinksListResult": + """Gets a list of service association links for a subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceAssociationLinksListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceAssociationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceAssociationLinksListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_endpoint_policies_operations.py new file mode 100644 index 0000000000000..0259df5ab33f2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_endpoint_policies_operations.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceEndpointPoliciesOperations: + """ServiceEndpointPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.ServiceEndpointPolicy": + """Gets the specified service Endpoint Policies in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceEndpointPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: "_models.ServiceEndpointPolicy", + **kwargs + ) -> "_models.ServiceEndpointPolicy": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: "_models.ServiceEndpointPolicy", + **kwargs + ) -> AsyncLROPoller["_models.ServiceEndpointPolicy"]: + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.ServiceEndpointPolicy": + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceEndpointPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: + """Gets all the service endpoint policies in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServiceEndpointPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ServiceEndpointPolicyListResult"]: + """Gets all service endpoint Policies in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServiceEndpointPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py new file mode 100644 index 0000000000000..5997936f47dbf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_endpoint_policy_definitions_operations.py @@ -0,0 +1,435 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceEndpointPolicyDefinitionsOperations: + """ServiceEndpointPolicyDefinitionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified ServiceEndpoint policy definitions. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the Service Endpoint Policy. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition. + :type service_endpoint_policy_definition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + **kwargs + ) -> "_models.ServiceEndpointPolicyDefinition": + """Get the specified service endpoint policy definitions from service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. + :type service_endpoint_policy_definition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceEndpointPolicyDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", + **kwargs + ) -> "_models.ServiceEndpointPolicyDefinition": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + service_endpoint_policy_definition_name: str, + service_endpoint_policy_definitions: "_models.ServiceEndpointPolicyDefinition", + **kwargs + ) -> AsyncLROPoller["_models.ServiceEndpointPolicyDefinition"]: + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. + :type service_endpoint_policy_definitions: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + service_endpoint_policy_definitions=service_endpoint_policy_definitions, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + service_endpoint_policy_name: str, + **kwargs + ) -> AsyncIterable["_models.ServiceEndpointPolicyDefinitionListResult"]: + """Gets all service endpoint policy definitions in a service end point policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. + :type service_endpoint_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServiceEndpointPolicyDefinitionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinitionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyDefinitionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_tags_operations.py new file mode 100644 index 0000000000000..c1b5848644610 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_service_tags_operations.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceTagsOperations: + """ServiceTagsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + location: str, + **kwargs + ) -> "_models.ServiceTagsListResult": + """Gets a list of service tag information resources. + + :param location: The location that will be used as a reference for version (not as a filter + based on location, you will get the list of service tags with prefix details across all regions + but limited to the cloud that your subscription belongs to). + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceTagsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceTagsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceTagsListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_subnets_operations.py new file mode 100644 index 0000000000000..66d039aacf10e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_subnets_operations.py @@ -0,0 +1,687 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SubnetsOperations: + """SubnetsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.Subnet": + """Gets the specified subnet by virtual network and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Subnet, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Subnet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Subnet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: "_models.Subnet", + **kwargs + ) -> "_models.Subnet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(subnet_parameters, 'Subnet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Subnet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Subnet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + subnet_parameters: "_models.Subnet", + **kwargs + ) -> AsyncLROPoller["_models.Subnet"]: + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. + :type subnet_parameters: ~azure.mgmt.network.v2020_07_01.models.Subnet + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subnet_parameters=subnet_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Subnet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + async def _prepare_network_policies_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._prepare_network_policies_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _prepare_network_policies_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies'} # type: ignore + + async def begin_prepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + prepare_network_policies_request_parameters: "_models.PrepareNetworkPoliciesRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. + :type prepare_network_policies_request_parameters: ~azure.mgmt.network.v2020_07_01.models.PrepareNetworkPoliciesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._prepare_network_policies_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + prepare_network_policies_request_parameters=prepare_network_policies_request_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_prepare_network_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies'} # type: ignore + + async def _unprepare_network_policies_initial( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._unprepare_network_policies_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _unprepare_network_policies_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies'} # type: ignore + + async def begin_unprepare_network_policies( + self, + resource_group_name: str, + virtual_network_name: str, + subnet_name: str, + unprepare_network_policies_request_parameters: "_models.UnprepareNetworkPoliciesRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. + :type unprepare_network_policies_request_parameters: ~azure.mgmt.network.v2020_07_01.models.UnprepareNetworkPoliciesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._unprepare_network_policies_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + unprepare_network_policies_request_parameters=unprepare_network_policies_request_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_unprepare_network_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> AsyncIterable["_models.SubnetListResult"]: + """Gets all subnets in a virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SubnetListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.SubnetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SubnetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_usages_operations.py new file mode 100644 index 0000000000000..4ab8094ffdfe7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_usages_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations: + """UsagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location: str, + **kwargs + ) -> AsyncIterable["_models.UsagesListResult"]: + """List network usages for a subscription. + + :param location: The location where resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._ ]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_appliance_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_appliance_sites_operations.py new file mode 100644 index 0000000000000..093d0521db145 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_appliance_sites_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualApplianceSitesOperations: + """VirtualApplianceSitesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified site from a Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + **kwargs + ) -> "_models.VirtualApplianceSite": + """Gets the specified Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualApplianceSite, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: "_models.VirtualApplianceSite", + **kwargs + ) -> "_models.VirtualApplianceSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualApplianceSite') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + site_name: str, + parameters: "_models.VirtualApplianceSite", + **kwargs + ) -> AsyncLROPoller["_models.VirtualApplianceSite"]: + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualApplianceSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + def list( + self, + resource_group_name: str, + network_virtual_appliance_name: str, + **kwargs + ) -> AsyncIterable["_models.NetworkVirtualApplianceSiteListResult"]: + """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceSiteListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSiteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceSiteListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_appliance_skus_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_appliance_skus_operations.py new file mode 100644 index 0000000000000..f47431526b208 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_appliance_skus_operations.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualApplianceSkusOperations: + """VirtualApplianceSkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.NetworkVirtualApplianceSkuListResult"]: + """List all SKUs available for a virtual appliance. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceSkuListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus'} # type: ignore + + async def get( + self, + sku_name: str, + **kwargs + ) -> "_models.NetworkVirtualApplianceSku": + """Retrieves a single available sku for network virtual appliance. + + :param sku_name: Name of the Sku. + :type sku_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkVirtualApplianceSku, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSku + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSku"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'skuName': self._serialize.url("sku_name", sku_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkVirtualApplianceSku', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_bgp_connection_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_bgp_connection_operations.py new file mode 100644 index 0000000000000..8604e7c73a936 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_bgp_connection_operations.py @@ -0,0 +1,356 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubBgpConnectionOperations: + """VirtualHubBgpConnectionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + **kwargs + ) -> "_models.BgpConnection": + """Retrieves the details of a Virtual Hub Bgp Connection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BgpConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.BgpConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: "_models.BgpConnection", + **kwargs + ) -> "_models.BgpConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BgpConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + parameters: "_models.BgpConnection", + **kwargs + ) -> AsyncLROPoller["_models.BgpConnection"]: + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :param parameters: Parameters of Bgp connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.BgpConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BgpConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_hub_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_bgp_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_bgp_connections_operations.py new file mode 100644 index 0000000000000..b29c923aa28cf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_bgp_connections_operations.py @@ -0,0 +1,364 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubBgpConnectionsOperations: + """VirtualHubBgpConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVirtualHubBgpConnectionResults"]: + """Retrieves the details of all VirtualHubBgpConnections. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubBgpConnectionResults or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubBgpConnectionResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubBgpConnectionResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubBgpConnectionResults', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections'} # type: ignore + + async def _list_learned_routes_initial( + self, + resource_group_name: str, + hub_name: str, + connection_name: str, + **kwargs + ) -> Optional["_models.PeerRouteList"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_learned_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_learned_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes'} # type: ignore + + async def begin_list_learned_routes( + self, + resource_group_name: str, + hub_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller["_models.PeerRouteList"]: + """Retrieves a list of routes the virtual hub bgp connection has learned. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PeerRouteList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PeerRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_learned_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes'} # type: ignore + + async def _list_advertised_routes_initial( + self, + resource_group_name: str, + hub_name: str, + connection_name: str, + **kwargs + ) -> Optional["_models.PeerRouteList"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_advertised_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_advertised_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes'} # type: ignore + + async def begin_list_advertised_routes( + self, + resource_group_name: str, + hub_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller["_models.PeerRouteList"]: + """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PeerRouteList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.PeerRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_advertised_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_ip_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_ip_configuration_operations.py new file mode 100644 index 0000000000000..f99ef89fd4df9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_ip_configuration_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubIpConfigurationOperations: + """VirtualHubIpConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + **kwargs + ) -> "_models.HubIpConfiguration": + """Retrieves the details of a Virtual Hub Ip configuration. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. + :type ip_config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HubIpConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: "_models.HubIpConfiguration", + **kwargs + ) -> "_models.HubIpConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'HubIpConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + parameters: "_models.HubIpConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.HubIpConfiguration"]: + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either HubIpConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_hub_name: str, + ip_config_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. + :type ip_config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVirtualHubIpConfigurationResults"]: + """Retrieves the details of all VirtualHubIpConfigurations. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubIpConfigurationResults or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubIpConfigurationResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubIpConfigurationResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubIpConfigurationResults', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py new file mode 100644 index 0000000000000..2f60055069e0b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hub_route_table_v2_s_operations.py @@ -0,0 +1,435 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubRouteTableV2SOperations: + """VirtualHubRouteTableV2SOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + **kwargs + ) -> "_models.VirtualHubRouteTableV2": + """Retrieves the details of a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualHubRouteTableV2, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", + **kwargs + ) -> "_models.VirtualHubRouteTableV2": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_hub_route_table_v2_parameters, 'VirtualHubRouteTableV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + virtual_hub_route_table_v2_parameters: "_models.VirtualHubRouteTableV2", + **kwargs + ) -> AsyncLROPoller["_models.VirtualHubRouteTableV2"]: + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. + :type virtual_hub_route_table_v2_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + virtual_hub_route_table_v2_parameters=virtual_hub_route_table_v2_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_hub_name: str, + route_table_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVirtualHubRouteTableV2SResult"]: + """Retrieves the details of all VirtualHubRouteTableV2s. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubRouteTableV2SResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubRouteTableV2SResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubRouteTableV2SResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hubs_operations.py new file mode 100644 index 0000000000000..3c417a8086c74 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_hubs_operations.py @@ -0,0 +1,662 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubsOperations: + """VirtualHubsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> "_models.VirtualHub": + """Retrieves the details of a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualHub, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: "_models.VirtualHub", + **kwargs + ) -> "_models.VirtualHub": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: "_models.VirtualHub", + **kwargs + ) -> AsyncLROPoller["_models.VirtualHub"]: + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. + :type virtual_hub_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualHub + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + virtual_hub_parameters=virtual_hub_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + virtual_hub_name: str, + virtual_hub_parameters: "_models.TagsObject", + **kwargs + ) -> "_models.VirtualHub": + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. + :type virtual_hub_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualHub, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_hub_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: + """Lists all the VirtualHubs in a resource group. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ListVirtualHubsResult"]: + """Lists all the VirtualHubs in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs'} # type: ignore + + async def _get_effective_virtual_hub_routes_initial( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional["_models.EffectiveRoutesParameters"] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_effective_virtual_hub_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if effective_routes_parameters is not None: + body_content = self._serialize.body(effective_routes_parameters, 'EffectiveRoutesParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _get_effective_virtual_hub_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes'} # type: ignore + + async def begin_get_effective_virtual_hub_routes( + self, + resource_group_name: str, + virtual_hub_name: str, + effective_routes_parameters: Optional["_models.EffectiveRoutesParameters"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. + :type effective_routes_parameters: ~azure.mgmt.network.v2020_07_01.models.EffectiveRoutesParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_effective_virtual_hub_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + effective_routes_parameters=effective_routes_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_effective_virtual_hub_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_gateway_connections_operations.py new file mode 100644 index 0000000000000..dc20f0193961d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_gateway_connections_operations.py @@ -0,0 +1,1122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkGatewayConnectionsOperations: + """VirtualNetworkGatewayConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.VirtualNetworkGatewayConnection", + **kwargs + ) -> "_models.VirtualNetworkGatewayConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.VirtualNetworkGatewayConnection", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + **kwargs + ) -> "_models.VirtualNetworkGatewayConnection": + """Gets the specified virtual network gateway connection by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkGatewayConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network Gateway connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> Optional["_models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + async def _set_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.ConnectionSharedKey", + **kwargs + ) -> "_models.ConnectionSharedKey": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._set_shared_key_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectionSharedKey') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _set_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore + + async def begin_set_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.ConnectionSharedKey", + **kwargs + ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectionSharedKey + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._set_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore + + async def get_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + **kwargs + ) -> "_models.ConnectionSharedKey": + """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the + specified virtual network gateway connection shared key through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection shared + key name. + :type virtual_network_gateway_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionSharedKey, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ConnectionSharedKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_shared_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: + """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways + connections created. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkGatewayConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} # type: ignore + + async def _reset_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.ConnectionResetSharedKey", + **kwargs + ) -> Optional["_models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_shared_key_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore + + async def begin_reset_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.ConnectionResetSharedKey", + **kwargs + ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectionResetSharedKey + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture'} # type: ignore + + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, + **kwargs + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture'} # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.VpnPacketCaptureStopParameters", + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture'} # type: ignore + + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.VpnPacketCaptureStopParameters", + **kwargs + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_gateways_operations.py new file mode 100644 index 0000000000000..189e5e7db1f98 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_gateways_operations.py @@ -0,0 +1,2440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkGatewaysOperations: + """VirtualNetworkGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VirtualNetworkGateway", + **kwargs + ) -> "_models.VirtualNetworkGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VirtualNetworkGateway", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> "_models.VirtualNetworkGateway": + """Gets the specified virtual network gateway by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: + """Gets all virtual network gateways by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkGatewayListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} # type: ignore + + def list_connections( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: + """Gets all the connections in a virtual network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkGatewayListConnectionsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayListConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayListConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} # type: ignore + + async def _reset_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + gateway_vip: Optional[str] = None, + **kwargs + ) -> Optional["_models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if gateway_vip is not None: + query_parameters['gatewayVip'] = self._serialize.query("gateway_vip", gateway_vip, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore + + async def begin_reset( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + gateway_vip: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: + """Resets the primary of the virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param gateway_vip: Virtual network gateway vip address supplied to the begin reset of the + active-active feature enabled gateway. + :type gateway_vip: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + gateway_vip=gateway_vip, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore + + async def _reset_vpn_client_shared_key_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_vpn_client_shared_key_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_vpn_client_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey'} # type: ignore + + async def begin_reset_vpn_client_shared_key( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Resets the VPN client shared key of the virtual network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_vpn_client_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_vpn_client_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey'} # type: ignore + + async def _generatevpnclientpackage_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VpnClientParameters", + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generatevpnclientpackage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnClientParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generatevpnclientpackage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore + + async def begin_generatevpnclientpackage( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VpnClientParameters", + **kwargs + ) -> AsyncLROPoller[str]: + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnClientParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._generatevpnclientpackage_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore + + async def _generate_vpn_profile_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VpnClientParameters", + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generate_vpn_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnClientParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generate_vpn_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore + + async def begin_generate_vpn_profile( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VpnClientParameters", + **kwargs + ) -> AsyncLROPoller[str]: + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnClientParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore + + async def _get_vpn_profile_package_url_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_vpn_profile_package_url_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vpn_profile_package_url_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore + + async def begin_get_vpn_profile_package_url( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller[str]: + """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified + resource group. The profile needs to be generated first using generateVpnProfile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_vpn_profile_package_url_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore + + async def _get_bgp_peer_status_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + peer: Optional[str] = None, + **kwargs + ) -> Optional["_models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_bgp_peer_status_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if peer is not None: + query_parameters['peer'] = self._serialize.query("peer", peer, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_bgp_peer_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore + + async def begin_get_bgp_peer_status( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + peer: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: + """The GetBgpPeerStatus operation retrieves the status of all BGP peers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param peer: The IP address of the peer to retrieve the status of. + :type peer: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.BgpPeerStatusListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_bgp_peer_status_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore + + async def supported_vpn_devices( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> str: + """Gets a xml format representation for supported vpn devices. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.supported_vpn_devices.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + supported_vpn_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'} # type: ignore + + async def _get_learned_routes_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_learned_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_learned_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore + + async def begin_get_learned_routes( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: + """This operation retrieves a list of routes the virtual network gateway has learned, including + routes learned from BGP peers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_learned_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore + + async def _get_advertised_routes_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + peer: str, + **kwargs + ) -> Optional["_models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_advertised_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['peer'] = self._serialize.query("peer", peer, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_advertised_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore + + async def begin_get_advertised_routes( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + peer: str, + **kwargs + ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: + """This operation retrieves a list of routes the virtual network gateway is advertising to the + specified peer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param peer: The IP address of the peer. + :type peer: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_advertised_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore + + async def _set_vpnclient_ipsec_parameters_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", + **kwargs + ) -> Optional["_models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._set_vpnclient_ipsec_parameters_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _set_vpnclient_ipsec_parameters_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'} # type: ignore + + async def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + vpnclient_ipsec_params: "_models.VpnClientIPsecParameters", + **kwargs + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. + :type vpnclient_ipsec_params: ~azure.mgmt.network.v2020_07_01.models.VpnClientIPsecParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._set_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + vpnclient_ipsec_params=vpnclient_ipsec_params, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_set_vpnclient_ipsec_parameters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'} # type: ignore + + async def _get_vpnclient_ipsec_parameters_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> "_models.VpnClientIPsecParameters": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_vpnclient_ipsec_parameters_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vpnclient_ipsec_parameters_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'} # type: ignore + + async def begin_get_vpnclient_ipsec_parameters( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller["_models.VpnClientIPsecParameters"]: + """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec + policy for P2S client of virtual network gateway in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The virtual network gateway name. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vpnclient_ipsec_parameters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'} # type: ignore + + async def vpn_device_configuration_script( + self, + resource_group_name: str, + virtual_network_gateway_connection_name: str, + parameters: "_models.VpnDeviceScriptParameters", + **kwargs + ) -> str: + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnDeviceScriptParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.vpn_device_configuration_script.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + vpn_device_configuration_script.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'} # type: ignore + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture'} # type: ignore + + async def begin_start_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: Optional["_models.VpnPacketCaptureStartParameters"] = None, + **kwargs + ) -> AsyncLROPoller[str]: + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture'} # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VpnPacketCaptureStopParameters", + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture'} # type: ignore + + async def begin_stop_packet_capture( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + parameters: "_models.VpnPacketCaptureStopParameters", + **kwargs + ) -> AsyncLROPoller[str]: + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture'} # type: ignore + + async def _get_vpnclient_connection_health_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> Optional["_models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_vpnclient_connection_health_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnClientConnectionHealthDetailListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vpnclient_connection_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth'} # type: ignore + + async def begin_get_vpnclient_connection_health( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + **kwargs + ) -> AsyncLROPoller["_models.VpnClientConnectionHealthDetailListResult"]: + """Get VPN client connection health detail per P2S client connection of the virtual network + gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnClientConnectionHealthDetailListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_vpnclient_connection_health_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnClientConnectionHealthDetailListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vpnclient_connection_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth'} # type: ignore + + async def _disconnect_virtual_network_gateway_vpn_connections_initial( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: "_models.P2SVpnConnectionRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._disconnect_virtual_network_gateway_vpn_connections_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _disconnect_virtual_network_gateway_vpn_connections_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections'} # type: ignore + + async def begin_disconnect_virtual_network_gateway_vpn_connections( + self, + resource_group_name: str, + virtual_network_gateway_name: str, + request: "_models.P2SVpnConnectionRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. + :type request: ~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._disconnect_virtual_network_gateway_vpn_connections_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disconnect_virtual_network_gateway_vpn_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_peerings_operations.py new file mode 100644 index 0000000000000..2b45600404499 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_peerings_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkPeeringsOperations: + """VirtualNetworkPeeringsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. + :type virtual_network_peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + **kwargs + ) -> "_models.VirtualNetworkPeering": + """Gets the specified virtual network peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. + :type virtual_network_peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", + **kwargs + ) -> "_models.VirtualNetworkPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + virtual_network_peering_name: str, + virtual_network_peering_parameters: "_models.VirtualNetworkPeering", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. + :type virtual_network_peering_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + virtual_network_peering_parameters=virtual_network_peering_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: + """Gets all virtual network peerings in a virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkPeeringListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkPeeringListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_taps_operations.py new file mode 100644 index 0000000000000..2766a7c054b22 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_network_taps_operations.py @@ -0,0 +1,540 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkTapsOperations: + """VirtualNetworkTapsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + tap_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + tap_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network tap. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. + :type tap_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + tap_name: str, + **kwargs + ) -> "_models.VirtualNetworkTap": + """Gets information about the specified virtual network tap. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of virtual network tap. + :type tap_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkTap, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + tap_name: str, + parameters: "_models.VirtualNetworkTap", + **kwargs + ) -> "_models.VirtualNetworkTap": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetworkTap') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + tap_name: str, + parameters: "_models.VirtualNetworkTap", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetworkTap"]: + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + tap_name: str, + tap_parameters: "_models.TagsObject", + **kwargs + ) -> "_models.VirtualNetworkTap": + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of the tap. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. + :type tap_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkTap, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(tap_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkTapListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkTapListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkTapListResult"]: + """Gets all the VirtualNetworkTaps in a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkTapListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkTapListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_networks_operations.py new file mode 100644 index 0000000000000..67f80580fa1d4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_networks_operations.py @@ -0,0 +1,681 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworksOperations: + """VirtualNetworksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_network_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.VirtualNetwork": + """Gets the specified virtual network by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: "_models.VirtualNetwork", + **kwargs + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: "_models.VirtualNetwork", + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetwork"]: + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + virtual_network_name: str, + parameters: "_models.TagsObject", + **kwargs + ) -> "_models.VirtualNetwork": + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: + """Gets all virtual networks in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} # type: ignore + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkListResult"]: + """Gets all virtual networks in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} # type: ignore + + async def check_ip_address_availability( + self, + resource_group_name: str, + virtual_network_name: str, + ip_address: str, + **kwargs + ) -> "_models.IPAddressAvailabilityResult": + """Checks whether a private IP address is available for use. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param ip_address: The private IP address to be verified. + :type ip_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IPAddressAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IPAddressAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.check_ip_address_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['ipAddress'] = self._serialize.query("ip_address", ip_address, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IPAddressAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} # type: ignore + + def list_usage( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: + """Lists usage stats. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkListUsageResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkListUsageResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkListUsageResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_router_peerings_operations.py new file mode 100644 index 0000000000000..a789e1e1a1943 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_router_peerings_operations.py @@ -0,0 +1,435 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualRouterPeeringsOperations: + """VirtualRouterPeeringsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified peering from a Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + **kwargs + ) -> "_models.VirtualRouterPeering": + """Gets the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualRouterPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: "_models.VirtualRouterPeering", + **kwargs + ) -> "_models.VirtualRouterPeering": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualRouterPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + peering_name: str, + parameters: "_models.VirtualRouterPeering", + **kwargs + ) -> AsyncLROPoller["_models.VirtualRouterPeering"]: + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + def list( + self, + resource_group_name: str, + virtual_router_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualRouterPeeringListResult"]: + """Lists all Virtual Router Peerings in a Virtual Router resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualRouterPeeringListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualRouterPeeringListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_routers_operations.py new file mode 100644 index 0000000000000..8546d239b926a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_routers_operations.py @@ -0,0 +1,484 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualRoutersOperations: + """VirtualRoutersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( + self, + resource_group_name: str, + virtual_router_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_router_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_router_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.VirtualRouter": + """Gets the specified Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualRouter, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualRouter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: "_models.VirtualRouter", + **kwargs + ) -> "_models.VirtualRouter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualRouter') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_router_name: str, + parameters: "_models.VirtualRouter", + **kwargs + ) -> AsyncLROPoller["_models.VirtualRouter"]: + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualRouter + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualRouterListResult"]: + """Lists all Virtual Routers in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualRouterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualRouterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.VirtualRouterListResult"]: + """Gets all the Virtual Routers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualRouterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualRouterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_wans_operations.py new file mode 100644 index 0000000000000..f36c9b2addd1f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_virtual_wans_operations.py @@ -0,0 +1,540 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualWansOperations: + """VirtualWansOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + virtual_wan_name: str, + **kwargs + ) -> "_models.VirtualWAN": + """Retrieves the details of a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being retrieved. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualWAN, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: "_models.VirtualWAN", + **kwargs + ) -> "_models.VirtualWAN": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(wan_parameters, 'VirtualWAN') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: "_models.VirtualWAN", + **kwargs + ) -> AsyncLROPoller["_models.VirtualWAN"]: + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. + :type wan_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualWAN + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + virtual_wan_name: str, + wan_parameters: "_models.TagsObject", + **kwargs + ) -> "_models.VirtualWAN": + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. + :type wan_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualWAN, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(wan_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_wan_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being deleted. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: + """Lists all the VirtualWANs in a resource group. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualWANsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualWANsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ListVirtualWANsResult"]: + """Lists all the VirtualWANs in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualWANsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualWANsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_connections_operations.py new file mode 100644 index 0000000000000..7be50f51714fa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_connections_operations.py @@ -0,0 +1,705 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnConnectionsOperations: + """VpnConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + **kwargs + ) -> "_models.VpnConnection": + """Retrieves the details of a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: "_models.VpnConnection", + **kwargs + ) -> "_models.VpnConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + vpn_connection_parameters: "_models.VpnConnection", + **kwargs + ) -> AsyncLROPoller["_models.VpnConnection"]: + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. + :type vpn_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + vpn_connection_parameters=vpn_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional["_models.VpnConnectionPacketCaptureStartParameters"] = None, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnConnectionPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture'} # type: ignore + + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional["_models.VpnConnectionPacketCaptureStartParameters"] = None, + **kwargs + ) -> AsyncLROPoller[str]: + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnConnectionPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture'} # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional["_models.VpnConnectionPacketCaptureStopParameters"] = None, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnConnectionPacketCaptureStopParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture'} # type: ignore + + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + vpn_connection_name: str, + parameters: Optional["_models.VpnConnectionPacketCaptureStopParameters"] = None, + **kwargs + ) -> AsyncLROPoller[str]: + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnConnectionPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture'} # type: ignore + + def list_by_vpn_gateway( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVpnConnectionsResult"]: + """Retrieves all vpn connections for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnConnectionsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vpn_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_vpn_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_gateways_operations.py new file mode 100644 index 0000000000000..0c5911554089c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_gateways_operations.py @@ -0,0 +1,977 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnGatewaysOperations: + """VpnGatewaysOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> "_models.VpnGateway": + """Retrieves the details of a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: "_models.VpnGateway", + **kwargs + ) -> "_models.VpnGateway": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: "_models.VpnGateway", + **kwargs + ) -> AsyncLROPoller["_models.VpnGateway"]: + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: "_models.TagsObject", + **kwargs + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: "_models.TagsObject", + **kwargs + ) -> AsyncLROPoller["_models.VpnGateway"]: + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + async def _reset_initial( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> Optional["_models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset'} # type: ignore + + async def begin_reset( + self, + resource_group_name: str, + gateway_name: str, + **kwargs + ) -> AsyncLROPoller["_models.VpnGateway"]: + """Resets the primary of the vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset'} # type: ignore + + async def _start_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional["_models.VpnGatewayPacketCaptureStartParameters"] = None, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnGatewayPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture'} # type: ignore + + async def begin_start_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional["_models.VpnGatewayPacketCaptureStartParameters"] = None, + **kwargs + ) -> AsyncLROPoller[str]: + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnGatewayPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture'} # type: ignore + + async def _stop_packet_capture_initial( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional["_models.VpnGatewayPacketCaptureStopParameters"] = None, + **kwargs + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnGatewayPacketCaptureStopParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture'} # type: ignore + + async def begin_stop_packet_capture( + self, + resource_group_name: str, + gateway_name: str, + parameters: Optional["_models.VpnGatewayPacketCaptureStopParameters"] = None, + **kwargs + ) -> AsyncLROPoller[str]: + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnGatewayPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: + """Lists all the VpnGateways in a resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ListVpnGatewaysResult"]: + """Lists all the VpnGateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_link_connections_operations.py new file mode 100644 index 0000000000000..cc92fe87376b5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_link_connections_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnLinkConnectionsOperations: + """VpnLinkConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_vpn_connection( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVpnSiteLinkConnectionsResult"]: + """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn + connection. + + :param resource_group_name: The resource group name of the vpn gateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSiteLinkConnectionsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSiteLinkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vpn_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSiteLinkConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_vpn_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py new file mode 100644 index 0000000000000..eb5a0056dd3ad --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -0,0 +1,160 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnServerConfigurationsAssociatedWithVirtualWanOperations: + """VpnServerConfigurationsAssociatedWithVirtualWanOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _list_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + **kwargs + ) -> Optional["_models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnServerConfigurationsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations'} # type: ignore + + async def begin_list( + self, + resource_group_name: str, + virtual_wan_name: str, + **kwargs + ) -> AsyncLROPoller["_models.VpnServerConfigurationsResponse"]: + """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigurationsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnServerConfigurationsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_server_configurations_operations.py new file mode 100644 index 0000000000000..8f4cd2deaf4b6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_server_configurations_operations.py @@ -0,0 +1,544 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnServerConfigurationsOperations: + """VpnServerConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + **kwargs + ) -> "_models.VpnServerConfiguration": + """Retrieves the details of a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being retrieved. + :type vpn_server_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnServerConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", + **kwargs + ) -> "_models.VpnServerConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: "_models.VpnServerConfiguration", + **kwargs + ) -> AsyncLROPoller["_models.VpnServerConfiguration"]: + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + vpn_server_configuration_parameters=vpn_server_configuration_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + vpn_server_configuration_parameters: "_models.TagsObject", + **kwargs + ) -> "_models.VpnServerConfiguration": + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnServerConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vpn_server_configuration_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being deleted. + :type vpn_server_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: + """Lists all the vpnServerConfigurations in a resource group. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnServerConfigurationsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnServerConfigurationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ListVpnServerConfigurationsResult"]: + """Lists all the VpnServerConfigurations in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnServerConfigurationsResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnServerConfigurationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_site_link_connections_operations.py new file mode 100644 index 0000000000000..c045eadfd63bc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_site_link_connections_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnSiteLinkConnectionsOperations: + """VpnSiteLinkConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + gateway_name: str, + connection_name: str, + link_connection_name: str, + **kwargs + ) -> "_models.VpnSiteLinkConnection": + """Retrieves the details of a vpn site link connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :param link_connection_name: The name of the vpn connection. + :type link_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSiteLinkConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSiteLinkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'linkConnectionName': self._serialize.url("link_connection_name", link_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSiteLinkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_site_links_operations.py new file mode 100644 index 0000000000000..87117acc1593e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_site_links_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnSiteLinksOperations: + """VpnSiteLinksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_link_name: str, + **kwargs + ) -> "_models.VpnSiteLink": + """Retrieves the details of a VPN site link. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. + :type vpn_site_name: str + :param vpn_site_link_name: The name of the VpnSiteLink being retrieved. + :type vpn_site_link_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSiteLink, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSiteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + 'vpnSiteLinkName': self._serialize.url("vpn_site_link_name", vpn_site_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSiteLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}'} # type: ignore + + def list_by_vpn_site( + self, + resource_group_name: str, + vpn_site_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVpnSiteLinksResult"]: + """Lists all the vpnSiteLinks in a resource group for a vpn site. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. + :type vpn_site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSiteLinksResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSiteLinksResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vpn_site.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSiteLinksResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_vpn_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_sites_configuration_operations.py new file mode 100644 index 0000000000000..2bfacfa0a5f3d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_sites_configuration_operations.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnSitesConfigurationOperations: + """VpnSitesConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _download_initial( + self, + resource_group_name: str, + virtual_wan_name: str, + request: "_models.GetVpnSitesConfigurationRequest", + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._download_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration'} # type: ignore + + async def begin_download( + self, + resource_group_name: str, + virtual_wan_name: str, + request: "_models.GetVpnSitesConfigurationRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. + :type request: ~azure.mgmt.network.v2020_07_01.models.GetVpnSitesConfigurationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._download_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_sites_operations.py new file mode 100644 index 0000000000000..642ff2974ab66 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_vpn_sites_operations.py @@ -0,0 +1,540 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VpnSitesOperations: + """VpnSitesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + vpn_site_name: str, + **kwargs + ) -> "_models.VpnSite": + """Retrieves the details of a VPN site. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being retrieved. + :type vpn_site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSite, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: "_models.VpnSite", + **kwargs + ) -> "_models.VpnSite": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnSite', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: "_models.VpnSite", + **kwargs + ) -> AsyncLROPoller["_models.VpnSite"]: + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. + :type vpn_site_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnSite + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_07_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_parameters=vpn_site_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + vpn_site_name: str, + vpn_site_parameters: "_models.TagsObject", + **kwargs + ) -> "_models.VpnSite": + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. + :type vpn_site_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSite, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vpn_site_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vpn_site_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being deleted. + :type vpn_site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ListVpnSitesResult"]: + """Lists all the vpnSites in a resource group. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSitesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSitesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ListVpnSitesResult"]: + """Lists all the VpnSites in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSitesResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSitesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_web_application_firewall_policies_operations.py new file mode 100644 index 0000000000000..a8a9cef83f0b8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_web_application_firewall_policies_operations.py @@ -0,0 +1,416 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebApplicationFirewallPoliciesOperations: + """WebApplicationFirewallPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: + """Lists all of the protection policies within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebApplicationFirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebApplicationFirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies'} # type: ignore + + def list_all( + self, + **kwargs + ) -> AsyncIterable["_models.WebApplicationFirewallPolicyListResult"]: + """Gets all the WAF policies in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebApplicationFirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebApplicationFirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies'} # type: ignore + + async def get( + self, + resource_group_name: str, + policy_name: str, + **kwargs + ) -> "_models.WebApplicationFirewallPolicy": + """Retrieve protection policy with specified name within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the policy. + :type policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebApplicationFirewallPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebApplicationFirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + policy_name: str, + parameters: "_models.WebApplicationFirewallPolicy", + **kwargs + ) -> "_models.WebApplicationFirewallPolicy": + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the policy. + :type policy_name: str + :param parameters: Policy to be created. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebApplicationFirewallPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebApplicationFirewallPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('WebApplicationFirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + policy_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + policy_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the policy. + :type policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + policy_name=policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_web_categories_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_web_categories_operations.py new file mode 100644 index 0000000000000..700e281717324 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_web_categories_operations.py @@ -0,0 +1,167 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebCategoriesOperations: + """WebCategoriesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.AzureWebCategory": + """Gets the specified Azure Web Category. + + :param name: The name of the azureWebCategory. + :type name: str + :param expand: Expands resourceIds back referenced by the azureWebCategory resource. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureWebCategory, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.AzureWebCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureWebCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureWebCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.AzureWebCategoryListResult"]: + """Gets all the Azure Web Categories in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureWebCategoryListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureWebCategoryListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureWebCategoryListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AzureWebCategoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/__init__.py new file mode 100644 index 0000000000000..97b468bb5a073 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/__init__.py @@ -0,0 +1,1964 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AadAuthenticationParameters + from ._models_py3 import AddressSpace + from ._models_py3 import ApplicationGateway + from ._models_py3 import ApplicationGatewayAuthenticationCertificate + from ._models_py3 import ApplicationGatewayAutoscaleConfiguration + from ._models_py3 import ApplicationGatewayAvailableSslOptions + from ._models_py3 import ApplicationGatewayAvailableSslPredefinedPolicies + from ._models_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from ._models_py3 import ApplicationGatewayBackendAddress + from ._models_py3 import ApplicationGatewayBackendAddressPool + from ._models_py3 import ApplicationGatewayBackendHealth + from ._models_py3 import ApplicationGatewayBackendHealthHttpSettings + from ._models_py3 import ApplicationGatewayBackendHealthOnDemand + from ._models_py3 import ApplicationGatewayBackendHealthPool + from ._models_py3 import ApplicationGatewayBackendHealthServer + from ._models_py3 import ApplicationGatewayBackendHttpSettings + from ._models_py3 import ApplicationGatewayClientAuthConfiguration + from ._models_py3 import ApplicationGatewayConnectionDraining + from ._models_py3 import ApplicationGatewayCustomError + from ._models_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from ._models_py3 import ApplicationGatewayFirewallExclusion + from ._models_py3 import ApplicationGatewayFirewallRule + from ._models_py3 import ApplicationGatewayFirewallRuleGroup + from ._models_py3 import ApplicationGatewayFirewallRuleSet + from ._models_py3 import ApplicationGatewayFrontendIPConfiguration + from ._models_py3 import ApplicationGatewayFrontendPort + from ._models_py3 import ApplicationGatewayHeaderConfiguration + from ._models_py3 import ApplicationGatewayHttpListener + from ._models_py3 import ApplicationGatewayIPConfiguration + from ._models_py3 import ApplicationGatewayListResult + from ._models_py3 import ApplicationGatewayOnDemandProbe + from ._models_py3 import ApplicationGatewayPathRule + from ._models_py3 import ApplicationGatewayPrivateEndpointConnection + from ._models_py3 import ApplicationGatewayPrivateEndpointConnectionListResult + from ._models_py3 import ApplicationGatewayPrivateLinkConfiguration + from ._models_py3 import ApplicationGatewayPrivateLinkIpConfiguration + from ._models_py3 import ApplicationGatewayPrivateLinkResource + from ._models_py3 import ApplicationGatewayPrivateLinkResourceListResult + from ._models_py3 import ApplicationGatewayProbe + from ._models_py3 import ApplicationGatewayProbeHealthResponseMatch + from ._models_py3 import ApplicationGatewayRedirectConfiguration + from ._models_py3 import ApplicationGatewayRequestRoutingRule + from ._models_py3 import ApplicationGatewayRewriteRule + from ._models_py3 import ApplicationGatewayRewriteRuleActionSet + from ._models_py3 import ApplicationGatewayRewriteRuleCondition + from ._models_py3 import ApplicationGatewayRewriteRuleSet + from ._models_py3 import ApplicationGatewaySku + from ._models_py3 import ApplicationGatewaySslCertificate + from ._models_py3 import ApplicationGatewaySslPolicy + from ._models_py3 import ApplicationGatewaySslPredefinedPolicy + from ._models_py3 import ApplicationGatewaySslProfile + from ._models_py3 import ApplicationGatewayTrustedClientCertificate + from ._models_py3 import ApplicationGatewayTrustedRootCertificate + from ._models_py3 import ApplicationGatewayUrlConfiguration + from ._models_py3 import ApplicationGatewayUrlPathMap + from ._models_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from ._models_py3 import ApplicationRule + from ._models_py3 import ApplicationSecurityGroup + from ._models_py3 import ApplicationSecurityGroupListResult + from ._models_py3 import AuthorizationListResult + from ._models_py3 import AutoApprovedPrivateLinkService + from ._models_py3 import AutoApprovedPrivateLinkServicesResult + from ._models_py3 import Availability + from ._models_py3 import AvailableDelegation + from ._models_py3 import AvailableDelegationsResult + from ._models_py3 import AvailablePrivateEndpointType + from ._models_py3 import AvailablePrivateEndpointTypesResult + from ._models_py3 import AvailableProvidersList + from ._models_py3 import AvailableProvidersListCity + from ._models_py3 import AvailableProvidersListCountry + from ._models_py3 import AvailableProvidersListParameters + from ._models_py3 import AvailableProvidersListState + from ._models_py3 import AvailableServiceAlias + from ._models_py3 import AvailableServiceAliasesResult + from ._models_py3 import AzureAsyncOperationResult + from ._models_py3 import AzureFirewall + from ._models_py3 import AzureFirewallApplicationRule + from ._models_py3 import AzureFirewallApplicationRuleCollection + from ._models_py3 import AzureFirewallApplicationRuleProtocol + from ._models_py3 import AzureFirewallFqdnTag + from ._models_py3 import AzureFirewallFqdnTagListResult + from ._models_py3 import AzureFirewallIPConfiguration + from ._models_py3 import AzureFirewallIpGroups + from ._models_py3 import AzureFirewallListResult + from ._models_py3 import AzureFirewallNatRCAction + from ._models_py3 import AzureFirewallNatRule + from ._models_py3 import AzureFirewallNatRuleCollection + from ._models_py3 import AzureFirewallNetworkRule + from ._models_py3 import AzureFirewallNetworkRuleCollection + from ._models_py3 import AzureFirewallPublicIPAddress + from ._models_py3 import AzureFirewallRCAction + from ._models_py3 import AzureFirewallSku + from ._models_py3 import AzureReachabilityReport + from ._models_py3 import AzureReachabilityReportItem + from ._models_py3 import AzureReachabilityReportLatencyInfo + from ._models_py3 import AzureReachabilityReportLocation + from ._models_py3 import AzureReachabilityReportParameters + from ._models_py3 import AzureWebCategory + from ._models_py3 import AzureWebCategoryListResult + from ._models_py3 import BGPCommunity + from ._models_py3 import BackendAddressPool + from ._models_py3 import BastionActiveSession + from ._models_py3 import BastionActiveSessionListResult + from ._models_py3 import BastionHost + from ._models_py3 import BastionHostIPConfiguration + from ._models_py3 import BastionHostListResult + from ._models_py3 import BastionSessionDeleteResult + from ._models_py3 import BastionSessionState + from ._models_py3 import BastionShareableLink + from ._models_py3 import BastionShareableLinkListRequest + from ._models_py3 import BastionShareableLinkListResult + from ._models_py3 import BgpConnection + from ._models_py3 import BgpPeerStatus + from ._models_py3 import BgpPeerStatusListResult + from ._models_py3 import BgpServiceCommunity + from ._models_py3 import BgpServiceCommunityListResult + from ._models_py3 import BgpSettings + from ._models_py3 import BreakOutCategoryPolicies + from ._models_py3 import CheckPrivateLinkServiceVisibilityRequest + from ._models_py3 import CloudErrorBody + from ._models_py3 import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import ConnectionMonitor + from ._models_py3 import ConnectionMonitorDestination + from ._models_py3 import ConnectionMonitorEndpoint + from ._models_py3 import ConnectionMonitorEndpointFilter + from ._models_py3 import ConnectionMonitorEndpointFilterItem + from ._models_py3 import ConnectionMonitorEndpointScope + from ._models_py3 import ConnectionMonitorEndpointScopeItem + from ._models_py3 import ConnectionMonitorHttpConfiguration + from ._models_py3 import ConnectionMonitorIcmpConfiguration + from ._models_py3 import ConnectionMonitorListResult + from ._models_py3 import ConnectionMonitorOutput + from ._models_py3 import ConnectionMonitorParameters + from ._models_py3 import ConnectionMonitorQueryResult + from ._models_py3 import ConnectionMonitorResult + from ._models_py3 import ConnectionMonitorResultProperties + from ._models_py3 import ConnectionMonitorSource + from ._models_py3 import ConnectionMonitorSuccessThreshold + from ._models_py3 import ConnectionMonitorTcpConfiguration + from ._models_py3 import ConnectionMonitorTestConfiguration + from ._models_py3 import ConnectionMonitorTestGroup + from ._models_py3 import ConnectionMonitorWorkspaceSettings + from ._models_py3 import ConnectionResetSharedKey + from ._models_py3 import ConnectionSharedKey + from ._models_py3 import ConnectionStateSnapshot + from ._models_py3 import ConnectivityDestination + from ._models_py3 import ConnectivityHop + from ._models_py3 import ConnectivityInformation + from ._models_py3 import ConnectivityIssue + from ._models_py3 import ConnectivityParameters + from ._models_py3 import ConnectivitySource + from ._models_py3 import Container + from ._models_py3 import ContainerNetworkInterface + from ._models_py3 import ContainerNetworkInterfaceConfiguration + from ._models_py3 import ContainerNetworkInterfaceIpConfiguration + from ._models_py3 import CustomDnsConfigPropertiesFormat + from ._models_py3 import CustomIpPrefix + from ._models_py3 import CustomIpPrefixListResult + from ._models_py3 import DdosCustomPolicy + from ._models_py3 import DdosProtectionPlan + from ._models_py3 import DdosProtectionPlanListResult + from ._models_py3 import DdosSettings + from ._models_py3 import Delegation + from ._models_py3 import DeviceProperties + from ._models_py3 import DhcpOptions + from ._models_py3 import Dimension + from ._models_py3 import DnsNameAvailabilityResult + from ._models_py3 import DnsSettings + from ._models_py3 import DscpConfiguration + from ._models_py3 import DscpConfigurationListResult + from ._models_py3 import EffectiveNetworkSecurityGroup + from ._models_py3 import EffectiveNetworkSecurityGroupAssociation + from ._models_py3 import EffectiveNetworkSecurityGroupListResult + from ._models_py3 import EffectiveNetworkSecurityRule + from ._models_py3 import EffectiveRoute + from ._models_py3 import EffectiveRouteListResult + from ._models_py3 import EffectiveRoutesParameters + from ._models_py3 import EndpointServiceResult + from ._models_py3 import EndpointServicesListResult + from ._models_py3 import Error + from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorResponse + from ._models_py3 import EvaluatedNetworkSecurityGroup + from ._models_py3 import ExpressRouteCircuit + from ._models_py3 import ExpressRouteCircuitArpTable + from ._models_py3 import ExpressRouteCircuitAuthorization + from ._models_py3 import ExpressRouteCircuitConnection + from ._models_py3 import ExpressRouteCircuitConnectionListResult + from ._models_py3 import ExpressRouteCircuitListResult + from ._models_py3 import ExpressRouteCircuitPeering + from ._models_py3 import ExpressRouteCircuitPeeringConfig + from ._models_py3 import ExpressRouteCircuitPeeringId + from ._models_py3 import ExpressRouteCircuitPeeringListResult + from ._models_py3 import ExpressRouteCircuitReference + from ._models_py3 import ExpressRouteCircuitRoutesTable + from ._models_py3 import ExpressRouteCircuitRoutesTableSummary + from ._models_py3 import ExpressRouteCircuitServiceProviderProperties + from ._models_py3 import ExpressRouteCircuitSku + from ._models_py3 import ExpressRouteCircuitStats + from ._models_py3 import ExpressRouteCircuitsArpTableListResult + from ._models_py3 import ExpressRouteCircuitsRoutesTableListResult + from ._models_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from ._models_py3 import ExpressRouteConnection + from ._models_py3 import ExpressRouteConnectionId + from ._models_py3 import ExpressRouteConnectionList + from ._models_py3 import ExpressRouteCrossConnection + from ._models_py3 import ExpressRouteCrossConnectionListResult + from ._models_py3 import ExpressRouteCrossConnectionPeering + from ._models_py3 import ExpressRouteCrossConnectionPeeringList + from ._models_py3 import ExpressRouteCrossConnectionRoutesTableSummary + from ._models_py3 import ExpressRouteCrossConnectionsRoutesTableSummaryListResult + from ._models_py3 import ExpressRouteGateway + from ._models_py3 import ExpressRouteGatewayList + from ._models_py3 import ExpressRouteGatewayPropertiesAutoScaleConfiguration + from ._models_py3 import ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + from ._models_py3 import ExpressRouteLink + from ._models_py3 import ExpressRouteLinkListResult + from ._models_py3 import ExpressRouteLinkMacSecConfig + from ._models_py3 import ExpressRoutePort + from ._models_py3 import ExpressRoutePortListResult + from ._models_py3 import ExpressRoutePortsLocation + from ._models_py3 import ExpressRoutePortsLocationBandwidths + from ._models_py3 import ExpressRoutePortsLocationListResult + from ._models_py3 import ExpressRouteServiceProvider + from ._models_py3 import ExpressRouteServiceProviderBandwidthsOffered + from ._models_py3 import ExpressRouteServiceProviderListResult + from ._models_py3 import ExtendedLocation + from ._models_py3 import FirewallPolicy + from ._models_py3 import FirewallPolicyCertificateAuthority + from ._models_py3 import FirewallPolicyFilterRuleCollection + from ._models_py3 import FirewallPolicyFilterRuleCollectionAction + from ._models_py3 import FirewallPolicyIntrusionDetection + from ._models_py3 import FirewallPolicyIntrusionDetectionBypassTrafficSpecifications + from ._models_py3 import FirewallPolicyIntrusionDetectionConfiguration + from ._models_py3 import FirewallPolicyIntrusionDetectionSignatureSpecification + from ._models_py3 import FirewallPolicyListResult + from ._models_py3 import FirewallPolicyNatRuleCollection + from ._models_py3 import FirewallPolicyNatRuleCollectionAction + from ._models_py3 import FirewallPolicyRule + from ._models_py3 import FirewallPolicyRuleApplicationProtocol + from ._models_py3 import FirewallPolicyRuleCollection + from ._models_py3 import FirewallPolicyRuleCollectionGroup + from ._models_py3 import FirewallPolicyRuleCollectionGroupListResult + from ._models_py3 import FirewallPolicySku + from ._models_py3 import FirewallPolicyThreatIntelWhitelist + from ._models_py3 import FirewallPolicyTransportSecurity + from ._models_py3 import FlowLog + from ._models_py3 import FlowLogFormatParameters + from ._models_py3 import FlowLogInformation + from ._models_py3 import FlowLogListResult + from ._models_py3 import FlowLogStatusParameters + from ._models_py3 import FrontendIPConfiguration + from ._models_py3 import GatewayRoute + from ._models_py3 import GatewayRouteListResult + from ._models_py3 import GenerateExpressRoutePortsLOARequest + from ._models_py3 import GenerateExpressRoutePortsLOAResult + from ._models_py3 import GetVpnSitesConfigurationRequest + from ._models_py3 import HTTPConfiguration + from ._models_py3 import HTTPHeader + from ._models_py3 import HopLink + from ._models_py3 import HubIPAddresses + from ._models_py3 import HubIpConfiguration + from ._models_py3 import HubPublicIPAddresses + from ._models_py3 import HubRoute + from ._models_py3 import HubRouteTable + from ._models_py3 import HubVirtualNetworkConnection + from ._models_py3 import IPAddressAvailabilityResult + from ._models_py3 import IPConfiguration + from ._models_py3 import IPConfigurationBgpPeeringAddress + from ._models_py3 import IPConfigurationProfile + from ._models_py3 import InboundNatPool + from ._models_py3 import InboundNatRule + from ._models_py3 import InboundNatRuleListResult + from ._models_py3 import InboundSecurityRule + from ._models_py3 import InboundSecurityRules + from ._models_py3 import IpAllocation + from ._models_py3 import IpAllocationListResult + from ._models_py3 import IpGroup + from ._models_py3 import IpGroupListResult + from ._models_py3 import IpTag + from ._models_py3 import IpsecPolicy + from ._models_py3 import Ipv6CircuitConnectionConfig + from ._models_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from ._models_py3 import ListHubRouteTablesResult + from ._models_py3 import ListHubVirtualNetworkConnectionsResult + from ._models_py3 import ListP2SVpnGatewaysResult + from ._models_py3 import ListVirtualHubBgpConnectionResults + from ._models_py3 import ListVirtualHubIpConfigurationResults + from ._models_py3 import ListVirtualHubRouteTableV2SResult + from ._models_py3 import ListVirtualHubsResult + from ._models_py3 import ListVirtualWANsResult + from ._models_py3 import ListVpnConnectionsResult + from ._models_py3 import ListVpnGatewaysResult + from ._models_py3 import ListVpnServerConfigurationsResult + from ._models_py3 import ListVpnSiteLinkConnectionsResult + from ._models_py3 import ListVpnSiteLinksResult + from ._models_py3 import ListVpnSitesResult + from ._models_py3 import LoadBalancer + from ._models_py3 import LoadBalancerBackendAddress + from ._models_py3 import LoadBalancerBackendAddressPoolListResult + from ._models_py3 import LoadBalancerFrontendIPConfigurationListResult + from ._models_py3 import LoadBalancerListResult + from ._models_py3 import LoadBalancerLoadBalancingRuleListResult + from ._models_py3 import LoadBalancerOutboundRuleListResult + from ._models_py3 import LoadBalancerProbeListResult + from ._models_py3 import LoadBalancerSku + from ._models_py3 import LoadBalancingRule + from ._models_py3 import LocalNetworkGateway + from ._models_py3 import LocalNetworkGatewayListResult + from ._models_py3 import LogSpecification + from ._models_py3 import ManagedRuleGroupOverride + from ._models_py3 import ManagedRuleOverride + from ._models_py3 import ManagedRuleSet + from ._models_py3 import ManagedRulesDefinition + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import MatchCondition + from ._models_py3 import MatchVariable + from ._models_py3 import MatchedRule + from ._models_py3 import MetricSpecification + from ._models_py3 import NatGateway + from ._models_py3 import NatGatewayListResult + from ._models_py3 import NatGatewaySku + from ._models_py3 import NatRule + from ._models_py3 import NetworkConfigurationDiagnosticParameters + from ._models_py3 import NetworkConfigurationDiagnosticProfile + from ._models_py3 import NetworkConfigurationDiagnosticResponse + from ._models_py3 import NetworkConfigurationDiagnosticResult + from ._models_py3 import NetworkIntentPolicy + from ._models_py3 import NetworkIntentPolicyConfiguration + from ._models_py3 import NetworkInterface + from ._models_py3 import NetworkInterfaceAssociation + from ._models_py3 import NetworkInterfaceDnsSettings + from ._models_py3 import NetworkInterfaceIPConfiguration + from ._models_py3 import NetworkInterfaceIPConfigurationListResult + from ._models_py3 import NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties + from ._models_py3 import NetworkInterfaceListResult + from ._models_py3 import NetworkInterfaceLoadBalancerListResult + from ._models_py3 import NetworkInterfaceTapConfiguration + from ._models_py3 import NetworkInterfaceTapConfigurationListResult + from ._models_py3 import NetworkProfile + from ._models_py3 import NetworkProfileListResult + from ._models_py3 import NetworkRule + from ._models_py3 import NetworkSecurityGroup + from ._models_py3 import NetworkSecurityGroupListResult + from ._models_py3 import NetworkSecurityGroupResult + from ._models_py3 import NetworkSecurityRulesEvaluationResult + from ._models_py3 import NetworkVirtualAppliance + from ._models_py3 import NetworkVirtualApplianceListResult + from ._models_py3 import NetworkVirtualApplianceSiteListResult + from ._models_py3 import NetworkVirtualApplianceSku + from ._models_py3 import NetworkVirtualApplianceSkuInstances + from ._models_py3 import NetworkVirtualApplianceSkuListResult + from ._models_py3 import NetworkWatcher + from ._models_py3 import NetworkWatcherListResult + from ._models_py3 import NextHopParameters + from ._models_py3 import NextHopResult + from ._models_py3 import O365BreakOutCategoryPolicies + from ._models_py3 import O365PolicyProperties + from ._models_py3 import Office365PolicyProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import OperationPropertiesFormatServiceSpecification + from ._models_py3 import OutboundRule + from ._models_py3 import OwaspCrsExclusionEntry + from ._models_py3 import P2SConnectionConfiguration + from ._models_py3 import P2SVpnConnectionHealth + from ._models_py3 import P2SVpnConnectionHealthRequest + from ._models_py3 import P2SVpnConnectionRequest + from ._models_py3 import P2SVpnGateway + from ._models_py3 import P2SVpnProfileParameters + from ._models_py3 import PacketCapture + from ._models_py3 import PacketCaptureFilter + from ._models_py3 import PacketCaptureListResult + from ._models_py3 import PacketCaptureParameters + from ._models_py3 import PacketCaptureQueryStatusResult + from ._models_py3 import PacketCaptureResult + from ._models_py3 import PacketCaptureResultProperties + from ._models_py3 import PacketCaptureStorageLocation + from ._models_py3 import PatchRouteFilter + from ._models_py3 import PatchRouteFilterRule + from ._models_py3 import PeerExpressRouteCircuitConnection + from ._models_py3 import PeerExpressRouteCircuitConnectionListResult + from ._models_py3 import PeerRoute + from ._models_py3 import PeerRouteList + from ._models_py3 import PolicySettings + from ._models_py3 import PrepareNetworkPoliciesRequest + from ._models_py3 import PrivateDnsZoneConfig + from ._models_py3 import PrivateDnsZoneGroup + from ._models_py3 import PrivateDnsZoneGroupListResult + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateEndpointListResult + from ._models_py3 import PrivateLinkService + from ._models_py3 import PrivateLinkServiceConnection + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import PrivateLinkServiceIpConfiguration + from ._models_py3 import PrivateLinkServiceListResult + from ._models_py3 import PrivateLinkServicePropertiesAutoApproval + from ._models_py3 import PrivateLinkServicePropertiesVisibility + from ._models_py3 import PrivateLinkServiceVisibility + from ._models_py3 import Probe + from ._models_py3 import PropagatedRouteTable + from ._models_py3 import ProtocolConfiguration + from ._models_py3 import ProtocolCustomSettingsFormat + from ._models_py3 import PublicIPAddress + from ._models_py3 import PublicIPAddressDnsSettings + from ._models_py3 import PublicIPAddressListResult + from ._models_py3 import PublicIPAddressSku + from ._models_py3 import PublicIPPrefix + from ._models_py3 import PublicIPPrefixListResult + from ._models_py3 import PublicIPPrefixSku + from ._models_py3 import QosIpRange + from ._models_py3 import QosPortRange + from ._models_py3 import QueryTroubleshootingParameters + from ._models_py3 import RadiusServer + from ._models_py3 import RecordSet + from ._models_py3 import ReferencedPublicIpAddress + from ._models_py3 import Resource + from ._models_py3 import ResourceNavigationLink + from ._models_py3 import ResourceNavigationLinksListResult + from ._models_py3 import ResourceSet + from ._models_py3 import RetentionPolicyParameters + from ._models_py3 import Route + from ._models_py3 import RouteFilter + from ._models_py3 import RouteFilterListResult + from ._models_py3 import RouteFilterRule + from ._models_py3 import RouteFilterRuleListResult + from ._models_py3 import RouteListResult + from ._models_py3 import RouteTable + from ._models_py3 import RouteTableListResult + from ._models_py3 import RoutingConfiguration + from ._models_py3 import SecurityGroupNetworkInterface + from ._models_py3 import SecurityGroupViewParameters + from ._models_py3 import SecurityGroupViewResult + from ._models_py3 import SecurityPartnerProvider + from ._models_py3 import SecurityPartnerProviderListResult + from ._models_py3 import SecurityRule + from ._models_py3 import SecurityRuleAssociations + from ._models_py3 import SecurityRuleListResult + from ._models_py3 import ServiceAssociationLink + from ._models_py3 import ServiceAssociationLinksListResult + from ._models_py3 import ServiceEndpointPolicy + from ._models_py3 import ServiceEndpointPolicyDefinition + from ._models_py3 import ServiceEndpointPolicyDefinitionListResult + from ._models_py3 import ServiceEndpointPolicyListResult + from ._models_py3 import ServiceEndpointPropertiesFormat + from ._models_py3 import ServiceTagInformation + from ._models_py3 import ServiceTagInformationPropertiesFormat + from ._models_py3 import ServiceTagsListResult + from ._models_py3 import SessionIds + from ._models_py3 import StaticRoute + from ._models_py3 import SubResource + from ._models_py3 import Subnet + from ._models_py3 import SubnetAssociation + from ._models_py3 import SubnetListResult + from ._models_py3 import TagsObject + from ._models_py3 import Topology + from ._models_py3 import TopologyAssociation + from ._models_py3 import TopologyParameters + from ._models_py3 import TopologyResource + from ._models_py3 import TrafficAnalyticsConfigurationProperties + from ._models_py3 import TrafficAnalyticsProperties + from ._models_py3 import TrafficSelectorPolicy + from ._models_py3 import TroubleshootingDetails + from ._models_py3 import TroubleshootingParameters + from ._models_py3 import TroubleshootingRecommendedActions + from ._models_py3 import TroubleshootingResult + from ._models_py3 import TunnelConnectionHealth + from ._models_py3 import UnprepareNetworkPoliciesRequest + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import UsagesListResult + from ._models_py3 import VM + from ._models_py3 import VerificationIPFlowParameters + from ._models_py3 import VerificationIPFlowResult + from ._models_py3 import VirtualApplianceNicProperties + from ._models_py3 import VirtualApplianceSite + from ._models_py3 import VirtualApplianceSkuProperties + from ._models_py3 import VirtualHub + from ._models_py3 import VirtualHubEffectiveRoute + from ._models_py3 import VirtualHubEffectiveRouteList + from ._models_py3 import VirtualHubId + from ._models_py3 import VirtualHubRoute + from ._models_py3 import VirtualHubRouteTable + from ._models_py3 import VirtualHubRouteTableV2 + from ._models_py3 import VirtualHubRouteV2 + from ._models_py3 import VirtualNetwork + from ._models_py3 import VirtualNetworkBgpCommunities + from ._models_py3 import VirtualNetworkConnectionGatewayReference + from ._models_py3 import VirtualNetworkGateway + from ._models_py3 import VirtualNetworkGatewayConnection + from ._models_py3 import VirtualNetworkGatewayConnectionListEntity + from ._models_py3 import VirtualNetworkGatewayConnectionListResult + from ._models_py3 import VirtualNetworkGatewayIPConfiguration + from ._models_py3 import VirtualNetworkGatewayListConnectionsResult + from ._models_py3 import VirtualNetworkGatewayListResult + from ._models_py3 import VirtualNetworkGatewaySku + from ._models_py3 import VirtualNetworkListResult + from ._models_py3 import VirtualNetworkListUsageResult + from ._models_py3 import VirtualNetworkPeering + from ._models_py3 import VirtualNetworkPeeringListResult + from ._models_py3 import VirtualNetworkTap + from ._models_py3 import VirtualNetworkTapListResult + from ._models_py3 import VirtualNetworkUsage + from ._models_py3 import VirtualNetworkUsageName + from ._models_py3 import VirtualRouter + from ._models_py3 import VirtualRouterListResult + from ._models_py3 import VirtualRouterPeering + from ._models_py3 import VirtualRouterPeeringListResult + from ._models_py3 import VirtualWAN + from ._models_py3 import VirtualWanSecurityProvider + from ._models_py3 import VirtualWanSecurityProviders + from ._models_py3 import VirtualWanVpnProfileParameters + from ._models_py3 import VnetRoute + from ._models_py3 import VpnClientConfiguration + from ._models_py3 import VpnClientConnectionHealth + from ._models_py3 import VpnClientConnectionHealthDetail + from ._models_py3 import VpnClientConnectionHealthDetailListResult + from ._models_py3 import VpnClientIPsecParameters + from ._models_py3 import VpnClientParameters + from ._models_py3 import VpnClientRevokedCertificate + from ._models_py3 import VpnClientRootCertificate + from ._models_py3 import VpnConnection + from ._models_py3 import VpnConnectionPacketCaptureStartParameters + from ._models_py3 import VpnConnectionPacketCaptureStopParameters + from ._models_py3 import VpnDeviceScriptParameters + from ._models_py3 import VpnGateway + from ._models_py3 import VpnGatewayIpConfiguration + from ._models_py3 import VpnGatewayPacketCaptureStartParameters + from ._models_py3 import VpnGatewayPacketCaptureStopParameters + from ._models_py3 import VpnLinkBgpSettings + from ._models_py3 import VpnLinkProviderProperties + from ._models_py3 import VpnPacketCaptureStartParameters + from ._models_py3 import VpnPacketCaptureStopParameters + from ._models_py3 import VpnProfileResponse + from ._models_py3 import VpnServerConfigRadiusClientRootCertificate + from ._models_py3 import VpnServerConfigRadiusServerRootCertificate + from ._models_py3 import VpnServerConfigVpnClientRevokedCertificate + from ._models_py3 import VpnServerConfigVpnClientRootCertificate + from ._models_py3 import VpnServerConfiguration + from ._models_py3 import VpnServerConfigurationsResponse + from ._models_py3 import VpnSite + from ._models_py3 import VpnSiteId + from ._models_py3 import VpnSiteLink + from ._models_py3 import VpnSiteLinkConnection + from ._models_py3 import WebApplicationFirewallCustomRule + from ._models_py3 import WebApplicationFirewallPolicy + from ._models_py3 import WebApplicationFirewallPolicyListResult +except (SyntaxError, ImportError): + from ._models import AadAuthenticationParameters # type: ignore + from ._models import AddressSpace # type: ignore + from ._models import ApplicationGateway # type: ignore + from ._models import ApplicationGatewayAuthenticationCertificate # type: ignore + from ._models import ApplicationGatewayAutoscaleConfiguration # type: ignore + from ._models import ApplicationGatewayAvailableSslOptions # type: ignore + from ._models import ApplicationGatewayAvailableSslPredefinedPolicies # type: ignore + from ._models import ApplicationGatewayAvailableWafRuleSetsResult # type: ignore + from ._models import ApplicationGatewayBackendAddress # type: ignore + from ._models import ApplicationGatewayBackendAddressPool # type: ignore + from ._models import ApplicationGatewayBackendHealth # type: ignore + from ._models import ApplicationGatewayBackendHealthHttpSettings # type: ignore + from ._models import ApplicationGatewayBackendHealthOnDemand # type: ignore + from ._models import ApplicationGatewayBackendHealthPool # type: ignore + from ._models import ApplicationGatewayBackendHealthServer # type: ignore + from ._models import ApplicationGatewayBackendHttpSettings # type: ignore + from ._models import ApplicationGatewayClientAuthConfiguration # type: ignore + from ._models import ApplicationGatewayConnectionDraining # type: ignore + from ._models import ApplicationGatewayCustomError # type: ignore + from ._models import ApplicationGatewayFirewallDisabledRuleGroup # type: ignore + from ._models import ApplicationGatewayFirewallExclusion # type: ignore + from ._models import ApplicationGatewayFirewallRule # type: ignore + from ._models import ApplicationGatewayFirewallRuleGroup # type: ignore + from ._models import ApplicationGatewayFirewallRuleSet # type: ignore + from ._models import ApplicationGatewayFrontendIPConfiguration # type: ignore + from ._models import ApplicationGatewayFrontendPort # type: ignore + from ._models import ApplicationGatewayHeaderConfiguration # type: ignore + from ._models import ApplicationGatewayHttpListener # type: ignore + from ._models import ApplicationGatewayIPConfiguration # type: ignore + from ._models import ApplicationGatewayListResult # type: ignore + from ._models import ApplicationGatewayOnDemandProbe # type: ignore + from ._models import ApplicationGatewayPathRule # type: ignore + from ._models import ApplicationGatewayPrivateEndpointConnection # type: ignore + from ._models import ApplicationGatewayPrivateEndpointConnectionListResult # type: ignore + from ._models import ApplicationGatewayPrivateLinkConfiguration # type: ignore + from ._models import ApplicationGatewayPrivateLinkIpConfiguration # type: ignore + from ._models import ApplicationGatewayPrivateLinkResource # type: ignore + from ._models import ApplicationGatewayPrivateLinkResourceListResult # type: ignore + from ._models import ApplicationGatewayProbe # type: ignore + from ._models import ApplicationGatewayProbeHealthResponseMatch # type: ignore + from ._models import ApplicationGatewayRedirectConfiguration # type: ignore + from ._models import ApplicationGatewayRequestRoutingRule # type: ignore + from ._models import ApplicationGatewayRewriteRule # type: ignore + from ._models import ApplicationGatewayRewriteRuleActionSet # type: ignore + from ._models import ApplicationGatewayRewriteRuleCondition # type: ignore + from ._models import ApplicationGatewayRewriteRuleSet # type: ignore + from ._models import ApplicationGatewaySku # type: ignore + from ._models import ApplicationGatewaySslCertificate # type: ignore + from ._models import ApplicationGatewaySslPolicy # type: ignore + from ._models import ApplicationGatewaySslPredefinedPolicy # type: ignore + from ._models import ApplicationGatewaySslProfile # type: ignore + from ._models import ApplicationGatewayTrustedClientCertificate # type: ignore + from ._models import ApplicationGatewayTrustedRootCertificate # type: ignore + from ._models import ApplicationGatewayUrlConfiguration # type: ignore + from ._models import ApplicationGatewayUrlPathMap # type: ignore + from ._models import ApplicationGatewayWebApplicationFirewallConfiguration # type: ignore + from ._models import ApplicationRule # type: ignore + from ._models import ApplicationSecurityGroup # type: ignore + from ._models import ApplicationSecurityGroupListResult # type: ignore + from ._models import AuthorizationListResult # type: ignore + from ._models import AutoApprovedPrivateLinkService # type: ignore + from ._models import AutoApprovedPrivateLinkServicesResult # type: ignore + from ._models import Availability # type: ignore + from ._models import AvailableDelegation # type: ignore + from ._models import AvailableDelegationsResult # type: ignore + from ._models import AvailablePrivateEndpointType # type: ignore + from ._models import AvailablePrivateEndpointTypesResult # type: ignore + from ._models import AvailableProvidersList # type: ignore + from ._models import AvailableProvidersListCity # type: ignore + from ._models import AvailableProvidersListCountry # type: ignore + from ._models import AvailableProvidersListParameters # type: ignore + from ._models import AvailableProvidersListState # type: ignore + from ._models import AvailableServiceAlias # type: ignore + from ._models import AvailableServiceAliasesResult # type: ignore + from ._models import AzureAsyncOperationResult # type: ignore + from ._models import AzureFirewall # type: ignore + from ._models import AzureFirewallApplicationRule # type: ignore + from ._models import AzureFirewallApplicationRuleCollection # type: ignore + from ._models import AzureFirewallApplicationRuleProtocol # type: ignore + from ._models import AzureFirewallFqdnTag # type: ignore + from ._models import AzureFirewallFqdnTagListResult # type: ignore + from ._models import AzureFirewallIPConfiguration # type: ignore + from ._models import AzureFirewallIpGroups # type: ignore + from ._models import AzureFirewallListResult # type: ignore + from ._models import AzureFirewallNatRCAction # type: ignore + from ._models import AzureFirewallNatRule # type: ignore + from ._models import AzureFirewallNatRuleCollection # type: ignore + from ._models import AzureFirewallNetworkRule # type: ignore + from ._models import AzureFirewallNetworkRuleCollection # type: ignore + from ._models import AzureFirewallPublicIPAddress # type: ignore + from ._models import AzureFirewallRCAction # type: ignore + from ._models import AzureFirewallSku # type: ignore + from ._models import AzureReachabilityReport # type: ignore + from ._models import AzureReachabilityReportItem # type: ignore + from ._models import AzureReachabilityReportLatencyInfo # type: ignore + from ._models import AzureReachabilityReportLocation # type: ignore + from ._models import AzureReachabilityReportParameters # type: ignore + from ._models import AzureWebCategory # type: ignore + from ._models import AzureWebCategoryListResult # type: ignore + from ._models import BGPCommunity # type: ignore + from ._models import BackendAddressPool # type: ignore + from ._models import BastionActiveSession # type: ignore + from ._models import BastionActiveSessionListResult # type: ignore + from ._models import BastionHost # type: ignore + from ._models import BastionHostIPConfiguration # type: ignore + from ._models import BastionHostListResult # type: ignore + from ._models import BastionSessionDeleteResult # type: ignore + from ._models import BastionSessionState # type: ignore + from ._models import BastionShareableLink # type: ignore + from ._models import BastionShareableLinkListRequest # type: ignore + from ._models import BastionShareableLinkListResult # type: ignore + from ._models import BgpConnection # type: ignore + from ._models import BgpPeerStatus # type: ignore + from ._models import BgpPeerStatusListResult # type: ignore + from ._models import BgpServiceCommunity # type: ignore + from ._models import BgpServiceCommunityListResult # type: ignore + from ._models import BgpSettings # type: ignore + from ._models import BreakOutCategoryPolicies # type: ignore + from ._models import CheckPrivateLinkServiceVisibilityRequest # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import ConnectionMonitor # type: ignore + from ._models import ConnectionMonitorDestination # type: ignore + from ._models import ConnectionMonitorEndpoint # type: ignore + from ._models import ConnectionMonitorEndpointFilter # type: ignore + from ._models import ConnectionMonitorEndpointFilterItem # type: ignore + from ._models import ConnectionMonitorEndpointScope # type: ignore + from ._models import ConnectionMonitorEndpointScopeItem # type: ignore + from ._models import ConnectionMonitorHttpConfiguration # type: ignore + from ._models import ConnectionMonitorIcmpConfiguration # type: ignore + from ._models import ConnectionMonitorListResult # type: ignore + from ._models import ConnectionMonitorOutput # type: ignore + from ._models import ConnectionMonitorParameters # type: ignore + from ._models import ConnectionMonitorQueryResult # type: ignore + from ._models import ConnectionMonitorResult # type: ignore + from ._models import ConnectionMonitorResultProperties # type: ignore + from ._models import ConnectionMonitorSource # type: ignore + from ._models import ConnectionMonitorSuccessThreshold # type: ignore + from ._models import ConnectionMonitorTcpConfiguration # type: ignore + from ._models import ConnectionMonitorTestConfiguration # type: ignore + from ._models import ConnectionMonitorTestGroup # type: ignore + from ._models import ConnectionMonitorWorkspaceSettings # type: ignore + from ._models import ConnectionResetSharedKey # type: ignore + from ._models import ConnectionSharedKey # type: ignore + from ._models import ConnectionStateSnapshot # type: ignore + from ._models import ConnectivityDestination # type: ignore + from ._models import ConnectivityHop # type: ignore + from ._models import ConnectivityInformation # type: ignore + from ._models import ConnectivityIssue # type: ignore + from ._models import ConnectivityParameters # type: ignore + from ._models import ConnectivitySource # type: ignore + from ._models import Container # type: ignore + from ._models import ContainerNetworkInterface # type: ignore + from ._models import ContainerNetworkInterfaceConfiguration # type: ignore + from ._models import ContainerNetworkInterfaceIpConfiguration # type: ignore + from ._models import CustomDnsConfigPropertiesFormat # type: ignore + from ._models import CustomIpPrefix # type: ignore + from ._models import CustomIpPrefixListResult # type: ignore + from ._models import DdosCustomPolicy # type: ignore + from ._models import DdosProtectionPlan # type: ignore + from ._models import DdosProtectionPlanListResult # type: ignore + from ._models import DdosSettings # type: ignore + from ._models import Delegation # type: ignore + from ._models import DeviceProperties # type: ignore + from ._models import DhcpOptions # type: ignore + from ._models import Dimension # type: ignore + from ._models import DnsNameAvailabilityResult # type: ignore + from ._models import DnsSettings # type: ignore + from ._models import DscpConfiguration # type: ignore + from ._models import DscpConfigurationListResult # type: ignore + from ._models import EffectiveNetworkSecurityGroup # type: ignore + from ._models import EffectiveNetworkSecurityGroupAssociation # type: ignore + from ._models import EffectiveNetworkSecurityGroupListResult # type: ignore + from ._models import EffectiveNetworkSecurityRule # type: ignore + from ._models import EffectiveRoute # type: ignore + from ._models import EffectiveRouteListResult # type: ignore + from ._models import EffectiveRoutesParameters # type: ignore + from ._models import EndpointServiceResult # type: ignore + from ._models import EndpointServicesListResult # type: ignore + from ._models import Error # type: ignore + from ._models import ErrorDetails # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import EvaluatedNetworkSecurityGroup # type: ignore + from ._models import ExpressRouteCircuit # type: ignore + from ._models import ExpressRouteCircuitArpTable # type: ignore + from ._models import ExpressRouteCircuitAuthorization # type: ignore + from ._models import ExpressRouteCircuitConnection # type: ignore + from ._models import ExpressRouteCircuitConnectionListResult # type: ignore + from ._models import ExpressRouteCircuitListResult # type: ignore + from ._models import ExpressRouteCircuitPeering # type: ignore + from ._models import ExpressRouteCircuitPeeringConfig # type: ignore + from ._models import ExpressRouteCircuitPeeringId # type: ignore + from ._models import ExpressRouteCircuitPeeringListResult # type: ignore + from ._models import ExpressRouteCircuitReference # type: ignore + from ._models import ExpressRouteCircuitRoutesTable # type: ignore + from ._models import ExpressRouteCircuitRoutesTableSummary # type: ignore + from ._models import ExpressRouteCircuitServiceProviderProperties # type: ignore + from ._models import ExpressRouteCircuitSku # type: ignore + from ._models import ExpressRouteCircuitStats # type: ignore + from ._models import ExpressRouteCircuitsArpTableListResult # type: ignore + from ._models import ExpressRouteCircuitsRoutesTableListResult # type: ignore + from ._models import ExpressRouteCircuitsRoutesTableSummaryListResult # type: ignore + from ._models import ExpressRouteConnection # type: ignore + from ._models import ExpressRouteConnectionId # type: ignore + from ._models import ExpressRouteConnectionList # type: ignore + from ._models import ExpressRouteCrossConnection # type: ignore + from ._models import ExpressRouteCrossConnectionListResult # type: ignore + from ._models import ExpressRouteCrossConnectionPeering # type: ignore + from ._models import ExpressRouteCrossConnectionPeeringList # type: ignore + from ._models import ExpressRouteCrossConnectionRoutesTableSummary # type: ignore + from ._models import ExpressRouteCrossConnectionsRoutesTableSummaryListResult # type: ignore + from ._models import ExpressRouteGateway # type: ignore + from ._models import ExpressRouteGatewayList # type: ignore + from ._models import ExpressRouteGatewayPropertiesAutoScaleConfiguration # type: ignore + from ._models import ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds # type: ignore + from ._models import ExpressRouteLink # type: ignore + from ._models import ExpressRouteLinkListResult # type: ignore + from ._models import ExpressRouteLinkMacSecConfig # type: ignore + from ._models import ExpressRoutePort # type: ignore + from ._models import ExpressRoutePortListResult # type: ignore + from ._models import ExpressRoutePortsLocation # type: ignore + from ._models import ExpressRoutePortsLocationBandwidths # type: ignore + from ._models import ExpressRoutePortsLocationListResult # type: ignore + from ._models import ExpressRouteServiceProvider # type: ignore + from ._models import ExpressRouteServiceProviderBandwidthsOffered # type: ignore + from ._models import ExpressRouteServiceProviderListResult # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import FirewallPolicy # type: ignore + from ._models import FirewallPolicyCertificateAuthority # type: ignore + from ._models import FirewallPolicyFilterRuleCollection # type: ignore + from ._models import FirewallPolicyFilterRuleCollectionAction # type: ignore + from ._models import FirewallPolicyIntrusionDetection # type: ignore + from ._models import FirewallPolicyIntrusionDetectionBypassTrafficSpecifications # type: ignore + from ._models import FirewallPolicyIntrusionDetectionConfiguration # type: ignore + from ._models import FirewallPolicyIntrusionDetectionSignatureSpecification # type: ignore + from ._models import FirewallPolicyListResult # type: ignore + from ._models import FirewallPolicyNatRuleCollection # type: ignore + from ._models import FirewallPolicyNatRuleCollectionAction # type: ignore + from ._models import FirewallPolicyRule # type: ignore + from ._models import FirewallPolicyRuleApplicationProtocol # type: ignore + from ._models import FirewallPolicyRuleCollection # type: ignore + from ._models import FirewallPolicyRuleCollectionGroup # type: ignore + from ._models import FirewallPolicyRuleCollectionGroupListResult # type: ignore + from ._models import FirewallPolicySku # type: ignore + from ._models import FirewallPolicyThreatIntelWhitelist # type: ignore + from ._models import FirewallPolicyTransportSecurity # type: ignore + from ._models import FlowLog # type: ignore + from ._models import FlowLogFormatParameters # type: ignore + from ._models import FlowLogInformation # type: ignore + from ._models import FlowLogListResult # type: ignore + from ._models import FlowLogStatusParameters # type: ignore + from ._models import FrontendIPConfiguration # type: ignore + from ._models import GatewayRoute # type: ignore + from ._models import GatewayRouteListResult # type: ignore + from ._models import GenerateExpressRoutePortsLOARequest # type: ignore + from ._models import GenerateExpressRoutePortsLOAResult # type: ignore + from ._models import GetVpnSitesConfigurationRequest # type: ignore + from ._models import HTTPConfiguration # type: ignore + from ._models import HTTPHeader # type: ignore + from ._models import HopLink # type: ignore + from ._models import HubIPAddresses # type: ignore + from ._models import HubIpConfiguration # type: ignore + from ._models import HubPublicIPAddresses # type: ignore + from ._models import HubRoute # type: ignore + from ._models import HubRouteTable # type: ignore + from ._models import HubVirtualNetworkConnection # type: ignore + from ._models import IPAddressAvailabilityResult # type: ignore + from ._models import IPConfiguration # type: ignore + from ._models import IPConfigurationBgpPeeringAddress # type: ignore + from ._models import IPConfigurationProfile # type: ignore + from ._models import InboundNatPool # type: ignore + from ._models import InboundNatRule # type: ignore + from ._models import InboundNatRuleListResult # type: ignore + from ._models import InboundSecurityRule # type: ignore + from ._models import InboundSecurityRules # type: ignore + from ._models import IpAllocation # type: ignore + from ._models import IpAllocationListResult # type: ignore + from ._models import IpGroup # type: ignore + from ._models import IpGroupListResult # type: ignore + from ._models import IpTag # type: ignore + from ._models import IpsecPolicy # type: ignore + from ._models import Ipv6CircuitConnectionConfig # type: ignore + from ._models import Ipv6ExpressRouteCircuitPeeringConfig # type: ignore + from ._models import ListHubRouteTablesResult # type: ignore + from ._models import ListHubVirtualNetworkConnectionsResult # type: ignore + from ._models import ListP2SVpnGatewaysResult # type: ignore + from ._models import ListVirtualHubBgpConnectionResults # type: ignore + from ._models import ListVirtualHubIpConfigurationResults # type: ignore + from ._models import ListVirtualHubRouteTableV2SResult # type: ignore + from ._models import ListVirtualHubsResult # type: ignore + from ._models import ListVirtualWANsResult # type: ignore + from ._models import ListVpnConnectionsResult # type: ignore + from ._models import ListVpnGatewaysResult # type: ignore + from ._models import ListVpnServerConfigurationsResult # type: ignore + from ._models import ListVpnSiteLinkConnectionsResult # type: ignore + from ._models import ListVpnSiteLinksResult # type: ignore + from ._models import ListVpnSitesResult # type: ignore + from ._models import LoadBalancer # type: ignore + from ._models import LoadBalancerBackendAddress # type: ignore + from ._models import LoadBalancerBackendAddressPoolListResult # type: ignore + from ._models import LoadBalancerFrontendIPConfigurationListResult # type: ignore + from ._models import LoadBalancerListResult # type: ignore + from ._models import LoadBalancerLoadBalancingRuleListResult # type: ignore + from ._models import LoadBalancerOutboundRuleListResult # type: ignore + from ._models import LoadBalancerProbeListResult # type: ignore + from ._models import LoadBalancerSku # type: ignore + from ._models import LoadBalancingRule # type: ignore + from ._models import LocalNetworkGateway # type: ignore + from ._models import LocalNetworkGatewayListResult # type: ignore + from ._models import LogSpecification # type: ignore + from ._models import ManagedRuleGroupOverride # type: ignore + from ._models import ManagedRuleOverride # type: ignore + from ._models import ManagedRuleSet # type: ignore + from ._models import ManagedRulesDefinition # type: ignore + from ._models import ManagedServiceIdentity # type: ignore + from ._models import MatchCondition # type: ignore + from ._models import MatchVariable # type: ignore + from ._models import MatchedRule # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import NatGateway # type: ignore + from ._models import NatGatewayListResult # type: ignore + from ._models import NatGatewaySku # type: ignore + from ._models import NatRule # type: ignore + from ._models import NetworkConfigurationDiagnosticParameters # type: ignore + from ._models import NetworkConfigurationDiagnosticProfile # type: ignore + from ._models import NetworkConfigurationDiagnosticResponse # type: ignore + from ._models import NetworkConfigurationDiagnosticResult # type: ignore + from ._models import NetworkIntentPolicy # type: ignore + from ._models import NetworkIntentPolicyConfiguration # type: ignore + from ._models import NetworkInterface # type: ignore + from ._models import NetworkInterfaceAssociation # type: ignore + from ._models import NetworkInterfaceDnsSettings # type: ignore + from ._models import NetworkInterfaceIPConfiguration # type: ignore + from ._models import NetworkInterfaceIPConfigurationListResult # type: ignore + from ._models import NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties # type: ignore + from ._models import NetworkInterfaceListResult # type: ignore + from ._models import NetworkInterfaceLoadBalancerListResult # type: ignore + from ._models import NetworkInterfaceTapConfiguration # type: ignore + from ._models import NetworkInterfaceTapConfigurationListResult # type: ignore + from ._models import NetworkProfile # type: ignore + from ._models import NetworkProfileListResult # type: ignore + from ._models import NetworkRule # type: ignore + from ._models import NetworkSecurityGroup # type: ignore + from ._models import NetworkSecurityGroupListResult # type: ignore + from ._models import NetworkSecurityGroupResult # type: ignore + from ._models import NetworkSecurityRulesEvaluationResult # type: ignore + from ._models import NetworkVirtualAppliance # type: ignore + from ._models import NetworkVirtualApplianceListResult # type: ignore + from ._models import NetworkVirtualApplianceSiteListResult # type: ignore + from ._models import NetworkVirtualApplianceSku # type: ignore + from ._models import NetworkVirtualApplianceSkuInstances # type: ignore + from ._models import NetworkVirtualApplianceSkuListResult # type: ignore + from ._models import NetworkWatcher # type: ignore + from ._models import NetworkWatcherListResult # type: ignore + from ._models import NextHopParameters # type: ignore + from ._models import NextHopResult # type: ignore + from ._models import O365BreakOutCategoryPolicies # type: ignore + from ._models import O365PolicyProperties # type: ignore + from ._models import Office365PolicyProperties # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OperationPropertiesFormatServiceSpecification # type: ignore + from ._models import OutboundRule # type: ignore + from ._models import OwaspCrsExclusionEntry # type: ignore + from ._models import P2SConnectionConfiguration # type: ignore + from ._models import P2SVpnConnectionHealth # type: ignore + from ._models import P2SVpnConnectionHealthRequest # type: ignore + from ._models import P2SVpnConnectionRequest # type: ignore + from ._models import P2SVpnGateway # type: ignore + from ._models import P2SVpnProfileParameters # type: ignore + from ._models import PacketCapture # type: ignore + from ._models import PacketCaptureFilter # type: ignore + from ._models import PacketCaptureListResult # type: ignore + from ._models import PacketCaptureParameters # type: ignore + from ._models import PacketCaptureQueryStatusResult # type: ignore + from ._models import PacketCaptureResult # type: ignore + from ._models import PacketCaptureResultProperties # type: ignore + from ._models import PacketCaptureStorageLocation # type: ignore + from ._models import PatchRouteFilter # type: ignore + from ._models import PatchRouteFilterRule # type: ignore + from ._models import PeerExpressRouteCircuitConnection # type: ignore + from ._models import PeerExpressRouteCircuitConnectionListResult # type: ignore + from ._models import PeerRoute # type: ignore + from ._models import PeerRouteList # type: ignore + from ._models import PolicySettings # type: ignore + from ._models import PrepareNetworkPoliciesRequest # type: ignore + from ._models import PrivateDnsZoneConfig # type: ignore + from ._models import PrivateDnsZoneGroup # type: ignore + from ._models import PrivateDnsZoneGroupListResult # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateEndpointListResult # type: ignore + from ._models import PrivateLinkService # type: ignore + from ._models import PrivateLinkServiceConnection # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import PrivateLinkServiceIpConfiguration # type: ignore + from ._models import PrivateLinkServiceListResult # type: ignore + from ._models import PrivateLinkServicePropertiesAutoApproval # type: ignore + from ._models import PrivateLinkServicePropertiesVisibility # type: ignore + from ._models import PrivateLinkServiceVisibility # type: ignore + from ._models import Probe # type: ignore + from ._models import PropagatedRouteTable # type: ignore + from ._models import ProtocolConfiguration # type: ignore + from ._models import ProtocolCustomSettingsFormat # type: ignore + from ._models import PublicIPAddress # type: ignore + from ._models import PublicIPAddressDnsSettings # type: ignore + from ._models import PublicIPAddressListResult # type: ignore + from ._models import PublicIPAddressSku # type: ignore + from ._models import PublicIPPrefix # type: ignore + from ._models import PublicIPPrefixListResult # type: ignore + from ._models import PublicIPPrefixSku # type: ignore + from ._models import QosIpRange # type: ignore + from ._models import QosPortRange # type: ignore + from ._models import QueryTroubleshootingParameters # type: ignore + from ._models import RadiusServer # type: ignore + from ._models import RecordSet # type: ignore + from ._models import ReferencedPublicIpAddress # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceNavigationLink # type: ignore + from ._models import ResourceNavigationLinksListResult # type: ignore + from ._models import ResourceSet # type: ignore + from ._models import RetentionPolicyParameters # type: ignore + from ._models import Route # type: ignore + from ._models import RouteFilter # type: ignore + from ._models import RouteFilterListResult # type: ignore + from ._models import RouteFilterRule # type: ignore + from ._models import RouteFilterRuleListResult # type: ignore + from ._models import RouteListResult # type: ignore + from ._models import RouteTable # type: ignore + from ._models import RouteTableListResult # type: ignore + from ._models import RoutingConfiguration # type: ignore + from ._models import SecurityGroupNetworkInterface # type: ignore + from ._models import SecurityGroupViewParameters # type: ignore + from ._models import SecurityGroupViewResult # type: ignore + from ._models import SecurityPartnerProvider # type: ignore + from ._models import SecurityPartnerProviderListResult # type: ignore + from ._models import SecurityRule # type: ignore + from ._models import SecurityRuleAssociations # type: ignore + from ._models import SecurityRuleListResult # type: ignore + from ._models import ServiceAssociationLink # type: ignore + from ._models import ServiceAssociationLinksListResult # type: ignore + from ._models import ServiceEndpointPolicy # type: ignore + from ._models import ServiceEndpointPolicyDefinition # type: ignore + from ._models import ServiceEndpointPolicyDefinitionListResult # type: ignore + from ._models import ServiceEndpointPolicyListResult # type: ignore + from ._models import ServiceEndpointPropertiesFormat # type: ignore + from ._models import ServiceTagInformation # type: ignore + from ._models import ServiceTagInformationPropertiesFormat # type: ignore + from ._models import ServiceTagsListResult # type: ignore + from ._models import SessionIds # type: ignore + from ._models import StaticRoute # type: ignore + from ._models import SubResource # type: ignore + from ._models import Subnet # type: ignore + from ._models import SubnetAssociation # type: ignore + from ._models import SubnetListResult # type: ignore + from ._models import TagsObject # type: ignore + from ._models import Topology # type: ignore + from ._models import TopologyAssociation # type: ignore + from ._models import TopologyParameters # type: ignore + from ._models import TopologyResource # type: ignore + from ._models import TrafficAnalyticsConfigurationProperties # type: ignore + from ._models import TrafficAnalyticsProperties # type: ignore + from ._models import TrafficSelectorPolicy # type: ignore + from ._models import TroubleshootingDetails # type: ignore + from ._models import TroubleshootingParameters # type: ignore + from ._models import TroubleshootingRecommendedActions # type: ignore + from ._models import TroubleshootingResult # type: ignore + from ._models import TunnelConnectionHealth # type: ignore + from ._models import UnprepareNetworkPoliciesRequest # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageName # type: ignore + from ._models import UsagesListResult # type: ignore + from ._models import VM # type: ignore + from ._models import VerificationIPFlowParameters # type: ignore + from ._models import VerificationIPFlowResult # type: ignore + from ._models import VirtualApplianceNicProperties # type: ignore + from ._models import VirtualApplianceSite # type: ignore + from ._models import VirtualApplianceSkuProperties # type: ignore + from ._models import VirtualHub # type: ignore + from ._models import VirtualHubEffectiveRoute # type: ignore + from ._models import VirtualHubEffectiveRouteList # type: ignore + from ._models import VirtualHubId # type: ignore + from ._models import VirtualHubRoute # type: ignore + from ._models import VirtualHubRouteTable # type: ignore + from ._models import VirtualHubRouteTableV2 # type: ignore + from ._models import VirtualHubRouteV2 # type: ignore + from ._models import VirtualNetwork # type: ignore + from ._models import VirtualNetworkBgpCommunities # type: ignore + from ._models import VirtualNetworkConnectionGatewayReference # type: ignore + from ._models import VirtualNetworkGateway # type: ignore + from ._models import VirtualNetworkGatewayConnection # type: ignore + from ._models import VirtualNetworkGatewayConnectionListEntity # type: ignore + from ._models import VirtualNetworkGatewayConnectionListResult # type: ignore + from ._models import VirtualNetworkGatewayIPConfiguration # type: ignore + from ._models import VirtualNetworkGatewayListConnectionsResult # type: ignore + from ._models import VirtualNetworkGatewayListResult # type: ignore + from ._models import VirtualNetworkGatewaySku # type: ignore + from ._models import VirtualNetworkListResult # type: ignore + from ._models import VirtualNetworkListUsageResult # type: ignore + from ._models import VirtualNetworkPeering # type: ignore + from ._models import VirtualNetworkPeeringListResult # type: ignore + from ._models import VirtualNetworkTap # type: ignore + from ._models import VirtualNetworkTapListResult # type: ignore + from ._models import VirtualNetworkUsage # type: ignore + from ._models import VirtualNetworkUsageName # type: ignore + from ._models import VirtualRouter # type: ignore + from ._models import VirtualRouterListResult # type: ignore + from ._models import VirtualRouterPeering # type: ignore + from ._models import VirtualRouterPeeringListResult # type: ignore + from ._models import VirtualWAN # type: ignore + from ._models import VirtualWanSecurityProvider # type: ignore + from ._models import VirtualWanSecurityProviders # type: ignore + from ._models import VirtualWanVpnProfileParameters # type: ignore + from ._models import VnetRoute # type: ignore + from ._models import VpnClientConfiguration # type: ignore + from ._models import VpnClientConnectionHealth # type: ignore + from ._models import VpnClientConnectionHealthDetail # type: ignore + from ._models import VpnClientConnectionHealthDetailListResult # type: ignore + from ._models import VpnClientIPsecParameters # type: ignore + from ._models import VpnClientParameters # type: ignore + from ._models import VpnClientRevokedCertificate # type: ignore + from ._models import VpnClientRootCertificate # type: ignore + from ._models import VpnConnection # type: ignore + from ._models import VpnConnectionPacketCaptureStartParameters # type: ignore + from ._models import VpnConnectionPacketCaptureStopParameters # type: ignore + from ._models import VpnDeviceScriptParameters # type: ignore + from ._models import VpnGateway # type: ignore + from ._models import VpnGatewayIpConfiguration # type: ignore + from ._models import VpnGatewayPacketCaptureStartParameters # type: ignore + from ._models import VpnGatewayPacketCaptureStopParameters # type: ignore + from ._models import VpnLinkBgpSettings # type: ignore + from ._models import VpnLinkProviderProperties # type: ignore + from ._models import VpnPacketCaptureStartParameters # type: ignore + from ._models import VpnPacketCaptureStopParameters # type: ignore + from ._models import VpnProfileResponse # type: ignore + from ._models import VpnServerConfigRadiusClientRootCertificate # type: ignore + from ._models import VpnServerConfigRadiusServerRootCertificate # type: ignore + from ._models import VpnServerConfigVpnClientRevokedCertificate # type: ignore + from ._models import VpnServerConfigVpnClientRootCertificate # type: ignore + from ._models import VpnServerConfiguration # type: ignore + from ._models import VpnServerConfigurationsResponse # type: ignore + from ._models import VpnSite # type: ignore + from ._models import VpnSiteId # type: ignore + from ._models import VpnSiteLink # type: ignore + from ._models import VpnSiteLinkConnection # type: ignore + from ._models import WebApplicationFirewallCustomRule # type: ignore + from ._models import WebApplicationFirewallPolicy # type: ignore + from ._models import WebApplicationFirewallPolicyListResult # type: ignore + +from ._network_management_client_enums import ( + Access, + ApplicationGatewayBackendHealthServerHealth, + ApplicationGatewayCookieBasedAffinity, + ApplicationGatewayCustomErrorStatusCode, + ApplicationGatewayFirewallMode, + ApplicationGatewayOperationalState, + ApplicationGatewayProtocol, + ApplicationGatewayRedirectType, + ApplicationGatewayRequestRoutingRuleType, + ApplicationGatewaySkuName, + ApplicationGatewaySslCipherSuite, + ApplicationGatewaySslPolicyName, + ApplicationGatewaySslPolicyType, + ApplicationGatewaySslProtocol, + ApplicationGatewayTier, + AssociationType, + AuthenticationMethod, + AuthorizationUseStatus, + AzureFirewallApplicationRuleProtocolType, + AzureFirewallNatRCActionType, + AzureFirewallNetworkRuleProtocol, + AzureFirewallRCActionType, + AzureFirewallSkuName, + AzureFirewallSkuTier, + AzureFirewallThreatIntelMode, + BastionConnectProtocol, + BgpPeerState, + CircuitConnectionStatus, + CommissionedState, + ConnectionMonitorEndpointFilterItemType, + ConnectionMonitorEndpointFilterType, + ConnectionMonitorSourceStatus, + ConnectionMonitorTestConfigurationProtocol, + ConnectionMonitorType, + ConnectionState, + ConnectionStatus, + CoverageLevel, + DdosCustomPolicyProtocol, + DdosCustomPolicyTriggerSensitivityOverride, + DdosSettingsProtectionCoverage, + DestinationPortBehavior, + DhGroup, + Direction, + EffectiveRouteSource, + EffectiveRouteState, + EffectiveSecurityRuleProtocol, + EndpointType, + EvaluationState, + ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, + ExpressRouteCircuitPeeringState, + ExpressRouteCircuitSkuFamily, + ExpressRouteCircuitSkuTier, + ExpressRouteLinkAdminState, + ExpressRouteLinkConnectorType, + ExpressRouteLinkMacSecCipher, + ExpressRouteLinkMacSecSciState, + ExpressRoutePeeringState, + ExpressRoutePeeringType, + ExpressRoutePortsEncapsulation, + ExtendedLocationTypes, + FirewallPolicyFilterRuleCollectionActionType, + FirewallPolicyIntrusionDetectionProtocol, + FirewallPolicyIntrusionDetectionStateType, + FirewallPolicyNatRuleCollectionActionType, + FirewallPolicyRuleApplicationProtocolType, + FirewallPolicyRuleCollectionType, + FirewallPolicyRuleNetworkProtocol, + FirewallPolicyRuleType, + FirewallPolicySkuTier, + FlowLogFormatType, + HTTPConfigurationMethod, + HTTPMethod, + HubBgpConnectionStatus, + HubVirtualNetworkConnectionStatus, + IPAllocationMethod, + IPVersion, + IkeEncryption, + IkeIntegrity, + InboundSecurityRulesProtocol, + IpAllocationType, + IpFlowProtocol, + IpsecEncryption, + IpsecIntegrity, + IssueType, + LoadBalancerOutboundRuleProtocol, + LoadBalancerSkuName, + LoadBalancerSkuTier, + LoadDistribution, + ManagedRuleEnabledState, + NatGatewaySkuName, + NetworkOperationStatus, + NextHopType, + OfficeTrafficCategory, + Origin, + OutputType, + OwaspCrsExclusionEntryMatchVariable, + OwaspCrsExclusionEntrySelectorMatchOperator, + PcError, + PcProtocol, + PcStatus, + PfsGroup, + PreferredIPVersion, + ProbeProtocol, + ProcessorArchitecture, + Protocol, + ProtocolType, + ProvisioningState, + PublicIPAddressSkuName, + PublicIPAddressSkuTier, + PublicIPPrefixSkuName, + PublicIPPrefixSkuTier, + ResourceIdentityType, + RouteFilterRuleType, + RouteNextHopType, + RoutingState, + SecurityPartnerProviderConnectionStatus, + SecurityProviderName, + SecurityRuleAccess, + SecurityRuleDirection, + SecurityRuleProtocol, + ServiceProviderProvisioningState, + Severity, + TransportProtocol, + TunnelConnectionStatus, + UsageUnit, + VerbosityLevel, + VirtualNetworkGatewayConnectionMode, + VirtualNetworkGatewayConnectionProtocol, + VirtualNetworkGatewayConnectionStatus, + VirtualNetworkGatewayConnectionType, + VirtualNetworkGatewaySkuName, + VirtualNetworkGatewaySkuTier, + VirtualNetworkGatewayType, + VirtualNetworkPeeringState, + VirtualWanSecurityProviderType, + VpnAuthenticationType, + VpnClientProtocol, + VpnConnectionStatus, + VpnGatewayGeneration, + VpnGatewayTunnelingProtocol, + VpnType, + WebApplicationFirewallAction, + WebApplicationFirewallEnabledState, + WebApplicationFirewallMatchVariable, + WebApplicationFirewallMode, + WebApplicationFirewallOperator, + WebApplicationFirewallPolicyResourceState, + WebApplicationFirewallRuleType, + WebApplicationFirewallTransform, +) + +__all__ = [ + 'AadAuthenticationParameters', + 'AddressSpace', + 'ApplicationGateway', + 'ApplicationGatewayAuthenticationCertificate', + 'ApplicationGatewayAutoscaleConfiguration', + 'ApplicationGatewayAvailableSslOptions', + 'ApplicationGatewayAvailableSslPredefinedPolicies', + 'ApplicationGatewayAvailableWafRuleSetsResult', + 'ApplicationGatewayBackendAddress', + 'ApplicationGatewayBackendAddressPool', + 'ApplicationGatewayBackendHealth', + 'ApplicationGatewayBackendHealthHttpSettings', + 'ApplicationGatewayBackendHealthOnDemand', + 'ApplicationGatewayBackendHealthPool', + 'ApplicationGatewayBackendHealthServer', + 'ApplicationGatewayBackendHttpSettings', + 'ApplicationGatewayClientAuthConfiguration', + 'ApplicationGatewayConnectionDraining', + 'ApplicationGatewayCustomError', + 'ApplicationGatewayFirewallDisabledRuleGroup', + 'ApplicationGatewayFirewallExclusion', + 'ApplicationGatewayFirewallRule', + 'ApplicationGatewayFirewallRuleGroup', + 'ApplicationGatewayFirewallRuleSet', + 'ApplicationGatewayFrontendIPConfiguration', + 'ApplicationGatewayFrontendPort', + 'ApplicationGatewayHeaderConfiguration', + 'ApplicationGatewayHttpListener', + 'ApplicationGatewayIPConfiguration', + 'ApplicationGatewayListResult', + 'ApplicationGatewayOnDemandProbe', + 'ApplicationGatewayPathRule', + 'ApplicationGatewayPrivateEndpointConnection', + 'ApplicationGatewayPrivateEndpointConnectionListResult', + 'ApplicationGatewayPrivateLinkConfiguration', + 'ApplicationGatewayPrivateLinkIpConfiguration', + 'ApplicationGatewayPrivateLinkResource', + 'ApplicationGatewayPrivateLinkResourceListResult', + 'ApplicationGatewayProbe', + 'ApplicationGatewayProbeHealthResponseMatch', + 'ApplicationGatewayRedirectConfiguration', + 'ApplicationGatewayRequestRoutingRule', + 'ApplicationGatewayRewriteRule', + 'ApplicationGatewayRewriteRuleActionSet', + 'ApplicationGatewayRewriteRuleCondition', + 'ApplicationGatewayRewriteRuleSet', + 'ApplicationGatewaySku', + 'ApplicationGatewaySslCertificate', + 'ApplicationGatewaySslPolicy', + 'ApplicationGatewaySslPredefinedPolicy', + 'ApplicationGatewaySslProfile', + 'ApplicationGatewayTrustedClientCertificate', + 'ApplicationGatewayTrustedRootCertificate', + 'ApplicationGatewayUrlConfiguration', + 'ApplicationGatewayUrlPathMap', + 'ApplicationGatewayWebApplicationFirewallConfiguration', + 'ApplicationRule', + 'ApplicationSecurityGroup', + 'ApplicationSecurityGroupListResult', + 'AuthorizationListResult', + 'AutoApprovedPrivateLinkService', + 'AutoApprovedPrivateLinkServicesResult', + 'Availability', + 'AvailableDelegation', + 'AvailableDelegationsResult', + 'AvailablePrivateEndpointType', + 'AvailablePrivateEndpointTypesResult', + 'AvailableProvidersList', + 'AvailableProvidersListCity', + 'AvailableProvidersListCountry', + 'AvailableProvidersListParameters', + 'AvailableProvidersListState', + 'AvailableServiceAlias', + 'AvailableServiceAliasesResult', + 'AzureAsyncOperationResult', + 'AzureFirewall', + 'AzureFirewallApplicationRule', + 'AzureFirewallApplicationRuleCollection', + 'AzureFirewallApplicationRuleProtocol', + 'AzureFirewallFqdnTag', + 'AzureFirewallFqdnTagListResult', + 'AzureFirewallIPConfiguration', + 'AzureFirewallIpGroups', + 'AzureFirewallListResult', + 'AzureFirewallNatRCAction', + 'AzureFirewallNatRule', + 'AzureFirewallNatRuleCollection', + 'AzureFirewallNetworkRule', + 'AzureFirewallNetworkRuleCollection', + 'AzureFirewallPublicIPAddress', + 'AzureFirewallRCAction', + 'AzureFirewallSku', + 'AzureReachabilityReport', + 'AzureReachabilityReportItem', + 'AzureReachabilityReportLatencyInfo', + 'AzureReachabilityReportLocation', + 'AzureReachabilityReportParameters', + 'AzureWebCategory', + 'AzureWebCategoryListResult', + 'BGPCommunity', + 'BackendAddressPool', + 'BastionActiveSession', + 'BastionActiveSessionListResult', + 'BastionHost', + 'BastionHostIPConfiguration', + 'BastionHostListResult', + 'BastionSessionDeleteResult', + 'BastionSessionState', + 'BastionShareableLink', + 'BastionShareableLinkListRequest', + 'BastionShareableLinkListResult', + 'BgpConnection', + 'BgpPeerStatus', + 'BgpPeerStatusListResult', + 'BgpServiceCommunity', + 'BgpServiceCommunityListResult', + 'BgpSettings', + 'BreakOutCategoryPolicies', + 'CheckPrivateLinkServiceVisibilityRequest', + 'CloudErrorBody', + 'Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties', + 'ConnectionMonitor', + 'ConnectionMonitorDestination', + 'ConnectionMonitorEndpoint', + 'ConnectionMonitorEndpointFilter', + 'ConnectionMonitorEndpointFilterItem', + 'ConnectionMonitorEndpointScope', + 'ConnectionMonitorEndpointScopeItem', + 'ConnectionMonitorHttpConfiguration', + 'ConnectionMonitorIcmpConfiguration', + 'ConnectionMonitorListResult', + 'ConnectionMonitorOutput', + 'ConnectionMonitorParameters', + 'ConnectionMonitorQueryResult', + 'ConnectionMonitorResult', + 'ConnectionMonitorResultProperties', + 'ConnectionMonitorSource', + 'ConnectionMonitorSuccessThreshold', + 'ConnectionMonitorTcpConfiguration', + 'ConnectionMonitorTestConfiguration', + 'ConnectionMonitorTestGroup', + 'ConnectionMonitorWorkspaceSettings', + 'ConnectionResetSharedKey', + 'ConnectionSharedKey', + 'ConnectionStateSnapshot', + 'ConnectivityDestination', + 'ConnectivityHop', + 'ConnectivityInformation', + 'ConnectivityIssue', + 'ConnectivityParameters', + 'ConnectivitySource', + 'Container', + 'ContainerNetworkInterface', + 'ContainerNetworkInterfaceConfiguration', + 'ContainerNetworkInterfaceIpConfiguration', + 'CustomDnsConfigPropertiesFormat', + 'CustomIpPrefix', + 'CustomIpPrefixListResult', + 'DdosCustomPolicy', + 'DdosProtectionPlan', + 'DdosProtectionPlanListResult', + 'DdosSettings', + 'Delegation', + 'DeviceProperties', + 'DhcpOptions', + 'Dimension', + 'DnsNameAvailabilityResult', + 'DnsSettings', + 'DscpConfiguration', + 'DscpConfigurationListResult', + 'EffectiveNetworkSecurityGroup', + 'EffectiveNetworkSecurityGroupAssociation', + 'EffectiveNetworkSecurityGroupListResult', + 'EffectiveNetworkSecurityRule', + 'EffectiveRoute', + 'EffectiveRouteListResult', + 'EffectiveRoutesParameters', + 'EndpointServiceResult', + 'EndpointServicesListResult', + 'Error', + 'ErrorDetails', + 'ErrorResponse', + 'EvaluatedNetworkSecurityGroup', + 'ExpressRouteCircuit', + 'ExpressRouteCircuitArpTable', + 'ExpressRouteCircuitAuthorization', + 'ExpressRouteCircuitConnection', + 'ExpressRouteCircuitConnectionListResult', + 'ExpressRouteCircuitListResult', + 'ExpressRouteCircuitPeering', + 'ExpressRouteCircuitPeeringConfig', + 'ExpressRouteCircuitPeeringId', + 'ExpressRouteCircuitPeeringListResult', + 'ExpressRouteCircuitReference', + 'ExpressRouteCircuitRoutesTable', + 'ExpressRouteCircuitRoutesTableSummary', + 'ExpressRouteCircuitServiceProviderProperties', + 'ExpressRouteCircuitSku', + 'ExpressRouteCircuitStats', + 'ExpressRouteCircuitsArpTableListResult', + 'ExpressRouteCircuitsRoutesTableListResult', + 'ExpressRouteCircuitsRoutesTableSummaryListResult', + 'ExpressRouteConnection', + 'ExpressRouteConnectionId', + 'ExpressRouteConnectionList', + 'ExpressRouteCrossConnection', + 'ExpressRouteCrossConnectionListResult', + 'ExpressRouteCrossConnectionPeering', + 'ExpressRouteCrossConnectionPeeringList', + 'ExpressRouteCrossConnectionRoutesTableSummary', + 'ExpressRouteCrossConnectionsRoutesTableSummaryListResult', + 'ExpressRouteGateway', + 'ExpressRouteGatewayList', + 'ExpressRouteGatewayPropertiesAutoScaleConfiguration', + 'ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds', + 'ExpressRouteLink', + 'ExpressRouteLinkListResult', + 'ExpressRouteLinkMacSecConfig', + 'ExpressRoutePort', + 'ExpressRoutePortListResult', + 'ExpressRoutePortsLocation', + 'ExpressRoutePortsLocationBandwidths', + 'ExpressRoutePortsLocationListResult', + 'ExpressRouteServiceProvider', + 'ExpressRouteServiceProviderBandwidthsOffered', + 'ExpressRouteServiceProviderListResult', + 'ExtendedLocation', + 'FirewallPolicy', + 'FirewallPolicyCertificateAuthority', + 'FirewallPolicyFilterRuleCollection', + 'FirewallPolicyFilterRuleCollectionAction', + 'FirewallPolicyIntrusionDetection', + 'FirewallPolicyIntrusionDetectionBypassTrafficSpecifications', + 'FirewallPolicyIntrusionDetectionConfiguration', + 'FirewallPolicyIntrusionDetectionSignatureSpecification', + 'FirewallPolicyListResult', + 'FirewallPolicyNatRuleCollection', + 'FirewallPolicyNatRuleCollectionAction', + 'FirewallPolicyRule', + 'FirewallPolicyRuleApplicationProtocol', + 'FirewallPolicyRuleCollection', + 'FirewallPolicyRuleCollectionGroup', + 'FirewallPolicyRuleCollectionGroupListResult', + 'FirewallPolicySku', + 'FirewallPolicyThreatIntelWhitelist', + 'FirewallPolicyTransportSecurity', + 'FlowLog', + 'FlowLogFormatParameters', + 'FlowLogInformation', + 'FlowLogListResult', + 'FlowLogStatusParameters', + 'FrontendIPConfiguration', + 'GatewayRoute', + 'GatewayRouteListResult', + 'GenerateExpressRoutePortsLOARequest', + 'GenerateExpressRoutePortsLOAResult', + 'GetVpnSitesConfigurationRequest', + 'HTTPConfiguration', + 'HTTPHeader', + 'HopLink', + 'HubIPAddresses', + 'HubIpConfiguration', + 'HubPublicIPAddresses', + 'HubRoute', + 'HubRouteTable', + 'HubVirtualNetworkConnection', + 'IPAddressAvailabilityResult', + 'IPConfiguration', + 'IPConfigurationBgpPeeringAddress', + 'IPConfigurationProfile', + 'InboundNatPool', + 'InboundNatRule', + 'InboundNatRuleListResult', + 'InboundSecurityRule', + 'InboundSecurityRules', + 'IpAllocation', + 'IpAllocationListResult', + 'IpGroup', + 'IpGroupListResult', + 'IpTag', + 'IpsecPolicy', + 'Ipv6CircuitConnectionConfig', + 'Ipv6ExpressRouteCircuitPeeringConfig', + 'ListHubRouteTablesResult', + 'ListHubVirtualNetworkConnectionsResult', + 'ListP2SVpnGatewaysResult', + 'ListVirtualHubBgpConnectionResults', + 'ListVirtualHubIpConfigurationResults', + 'ListVirtualHubRouteTableV2SResult', + 'ListVirtualHubsResult', + 'ListVirtualWANsResult', + 'ListVpnConnectionsResult', + 'ListVpnGatewaysResult', + 'ListVpnServerConfigurationsResult', + 'ListVpnSiteLinkConnectionsResult', + 'ListVpnSiteLinksResult', + 'ListVpnSitesResult', + 'LoadBalancer', + 'LoadBalancerBackendAddress', + 'LoadBalancerBackendAddressPoolListResult', + 'LoadBalancerFrontendIPConfigurationListResult', + 'LoadBalancerListResult', + 'LoadBalancerLoadBalancingRuleListResult', + 'LoadBalancerOutboundRuleListResult', + 'LoadBalancerProbeListResult', + 'LoadBalancerSku', + 'LoadBalancingRule', + 'LocalNetworkGateway', + 'LocalNetworkGatewayListResult', + 'LogSpecification', + 'ManagedRuleGroupOverride', + 'ManagedRuleOverride', + 'ManagedRuleSet', + 'ManagedRulesDefinition', + 'ManagedServiceIdentity', + 'MatchCondition', + 'MatchVariable', + 'MatchedRule', + 'MetricSpecification', + 'NatGateway', + 'NatGatewayListResult', + 'NatGatewaySku', + 'NatRule', + 'NetworkConfigurationDiagnosticParameters', + 'NetworkConfigurationDiagnosticProfile', + 'NetworkConfigurationDiagnosticResponse', + 'NetworkConfigurationDiagnosticResult', + 'NetworkIntentPolicy', + 'NetworkIntentPolicyConfiguration', + 'NetworkInterface', + 'NetworkInterfaceAssociation', + 'NetworkInterfaceDnsSettings', + 'NetworkInterfaceIPConfiguration', + 'NetworkInterfaceIPConfigurationListResult', + 'NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties', + 'NetworkInterfaceListResult', + 'NetworkInterfaceLoadBalancerListResult', + 'NetworkInterfaceTapConfiguration', + 'NetworkInterfaceTapConfigurationListResult', + 'NetworkProfile', + 'NetworkProfileListResult', + 'NetworkRule', + 'NetworkSecurityGroup', + 'NetworkSecurityGroupListResult', + 'NetworkSecurityGroupResult', + 'NetworkSecurityRulesEvaluationResult', + 'NetworkVirtualAppliance', + 'NetworkVirtualApplianceListResult', + 'NetworkVirtualApplianceSiteListResult', + 'NetworkVirtualApplianceSku', + 'NetworkVirtualApplianceSkuInstances', + 'NetworkVirtualApplianceSkuListResult', + 'NetworkWatcher', + 'NetworkWatcherListResult', + 'NextHopParameters', + 'NextHopResult', + 'O365BreakOutCategoryPolicies', + 'O365PolicyProperties', + 'Office365PolicyProperties', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'OperationPropertiesFormatServiceSpecification', + 'OutboundRule', + 'OwaspCrsExclusionEntry', + 'P2SConnectionConfiguration', + 'P2SVpnConnectionHealth', + 'P2SVpnConnectionHealthRequest', + 'P2SVpnConnectionRequest', + 'P2SVpnGateway', + 'P2SVpnProfileParameters', + 'PacketCapture', + 'PacketCaptureFilter', + 'PacketCaptureListResult', + 'PacketCaptureParameters', + 'PacketCaptureQueryStatusResult', + 'PacketCaptureResult', + 'PacketCaptureResultProperties', + 'PacketCaptureStorageLocation', + 'PatchRouteFilter', + 'PatchRouteFilterRule', + 'PeerExpressRouteCircuitConnection', + 'PeerExpressRouteCircuitConnectionListResult', + 'PeerRoute', + 'PeerRouteList', + 'PolicySettings', + 'PrepareNetworkPoliciesRequest', + 'PrivateDnsZoneConfig', + 'PrivateDnsZoneGroup', + 'PrivateDnsZoneGroupListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateEndpointListResult', + 'PrivateLinkService', + 'PrivateLinkServiceConnection', + 'PrivateLinkServiceConnectionState', + 'PrivateLinkServiceIpConfiguration', + 'PrivateLinkServiceListResult', + 'PrivateLinkServicePropertiesAutoApproval', + 'PrivateLinkServicePropertiesVisibility', + 'PrivateLinkServiceVisibility', + 'Probe', + 'PropagatedRouteTable', + 'ProtocolConfiguration', + 'ProtocolCustomSettingsFormat', + 'PublicIPAddress', + 'PublicIPAddressDnsSettings', + 'PublicIPAddressListResult', + 'PublicIPAddressSku', + 'PublicIPPrefix', + 'PublicIPPrefixListResult', + 'PublicIPPrefixSku', + 'QosIpRange', + 'QosPortRange', + 'QueryTroubleshootingParameters', + 'RadiusServer', + 'RecordSet', + 'ReferencedPublicIpAddress', + 'Resource', + 'ResourceNavigationLink', + 'ResourceNavigationLinksListResult', + 'ResourceSet', + 'RetentionPolicyParameters', + 'Route', + 'RouteFilter', + 'RouteFilterListResult', + 'RouteFilterRule', + 'RouteFilterRuleListResult', + 'RouteListResult', + 'RouteTable', + 'RouteTableListResult', + 'RoutingConfiguration', + 'SecurityGroupNetworkInterface', + 'SecurityGroupViewParameters', + 'SecurityGroupViewResult', + 'SecurityPartnerProvider', + 'SecurityPartnerProviderListResult', + 'SecurityRule', + 'SecurityRuleAssociations', + 'SecurityRuleListResult', + 'ServiceAssociationLink', + 'ServiceAssociationLinksListResult', + 'ServiceEndpointPolicy', + 'ServiceEndpointPolicyDefinition', + 'ServiceEndpointPolicyDefinitionListResult', + 'ServiceEndpointPolicyListResult', + 'ServiceEndpointPropertiesFormat', + 'ServiceTagInformation', + 'ServiceTagInformationPropertiesFormat', + 'ServiceTagsListResult', + 'SessionIds', + 'StaticRoute', + 'SubResource', + 'Subnet', + 'SubnetAssociation', + 'SubnetListResult', + 'TagsObject', + 'Topology', + 'TopologyAssociation', + 'TopologyParameters', + 'TopologyResource', + 'TrafficAnalyticsConfigurationProperties', + 'TrafficAnalyticsProperties', + 'TrafficSelectorPolicy', + 'TroubleshootingDetails', + 'TroubleshootingParameters', + 'TroubleshootingRecommendedActions', + 'TroubleshootingResult', + 'TunnelConnectionHealth', + 'UnprepareNetworkPoliciesRequest', + 'Usage', + 'UsageName', + 'UsagesListResult', + 'VM', + 'VerificationIPFlowParameters', + 'VerificationIPFlowResult', + 'VirtualApplianceNicProperties', + 'VirtualApplianceSite', + 'VirtualApplianceSkuProperties', + 'VirtualHub', + 'VirtualHubEffectiveRoute', + 'VirtualHubEffectiveRouteList', + 'VirtualHubId', + 'VirtualHubRoute', + 'VirtualHubRouteTable', + 'VirtualHubRouteTableV2', + 'VirtualHubRouteV2', + 'VirtualNetwork', + 'VirtualNetworkBgpCommunities', + 'VirtualNetworkConnectionGatewayReference', + 'VirtualNetworkGateway', + 'VirtualNetworkGatewayConnection', + 'VirtualNetworkGatewayConnectionListEntity', + 'VirtualNetworkGatewayConnectionListResult', + 'VirtualNetworkGatewayIPConfiguration', + 'VirtualNetworkGatewayListConnectionsResult', + 'VirtualNetworkGatewayListResult', + 'VirtualNetworkGatewaySku', + 'VirtualNetworkListResult', + 'VirtualNetworkListUsageResult', + 'VirtualNetworkPeering', + 'VirtualNetworkPeeringListResult', + 'VirtualNetworkTap', + 'VirtualNetworkTapListResult', + 'VirtualNetworkUsage', + 'VirtualNetworkUsageName', + 'VirtualRouter', + 'VirtualRouterListResult', + 'VirtualRouterPeering', + 'VirtualRouterPeeringListResult', + 'VirtualWAN', + 'VirtualWanSecurityProvider', + 'VirtualWanSecurityProviders', + 'VirtualWanVpnProfileParameters', + 'VnetRoute', + 'VpnClientConfiguration', + 'VpnClientConnectionHealth', + 'VpnClientConnectionHealthDetail', + 'VpnClientConnectionHealthDetailListResult', + 'VpnClientIPsecParameters', + 'VpnClientParameters', + 'VpnClientRevokedCertificate', + 'VpnClientRootCertificate', + 'VpnConnection', + 'VpnConnectionPacketCaptureStartParameters', + 'VpnConnectionPacketCaptureStopParameters', + 'VpnDeviceScriptParameters', + 'VpnGateway', + 'VpnGatewayIpConfiguration', + 'VpnGatewayPacketCaptureStartParameters', + 'VpnGatewayPacketCaptureStopParameters', + 'VpnLinkBgpSettings', + 'VpnLinkProviderProperties', + 'VpnPacketCaptureStartParameters', + 'VpnPacketCaptureStopParameters', + 'VpnProfileResponse', + 'VpnServerConfigRadiusClientRootCertificate', + 'VpnServerConfigRadiusServerRootCertificate', + 'VpnServerConfigVpnClientRevokedCertificate', + 'VpnServerConfigVpnClientRootCertificate', + 'VpnServerConfiguration', + 'VpnServerConfigurationsResponse', + 'VpnSite', + 'VpnSiteId', + 'VpnSiteLink', + 'VpnSiteLinkConnection', + 'WebApplicationFirewallCustomRule', + 'WebApplicationFirewallPolicy', + 'WebApplicationFirewallPolicyListResult', + 'Access', + 'ApplicationGatewayBackendHealthServerHealth', + 'ApplicationGatewayCookieBasedAffinity', + 'ApplicationGatewayCustomErrorStatusCode', + 'ApplicationGatewayFirewallMode', + 'ApplicationGatewayOperationalState', + 'ApplicationGatewayProtocol', + 'ApplicationGatewayRedirectType', + 'ApplicationGatewayRequestRoutingRuleType', + 'ApplicationGatewaySkuName', + 'ApplicationGatewaySslCipherSuite', + 'ApplicationGatewaySslPolicyName', + 'ApplicationGatewaySslPolicyType', + 'ApplicationGatewaySslProtocol', + 'ApplicationGatewayTier', + 'AssociationType', + 'AuthenticationMethod', + 'AuthorizationUseStatus', + 'AzureFirewallApplicationRuleProtocolType', + 'AzureFirewallNatRCActionType', + 'AzureFirewallNetworkRuleProtocol', + 'AzureFirewallRCActionType', + 'AzureFirewallSkuName', + 'AzureFirewallSkuTier', + 'AzureFirewallThreatIntelMode', + 'BastionConnectProtocol', + 'BgpPeerState', + 'CircuitConnectionStatus', + 'CommissionedState', + 'ConnectionMonitorEndpointFilterItemType', + 'ConnectionMonitorEndpointFilterType', + 'ConnectionMonitorSourceStatus', + 'ConnectionMonitorTestConfigurationProtocol', + 'ConnectionMonitorType', + 'ConnectionState', + 'ConnectionStatus', + 'CoverageLevel', + 'DdosCustomPolicyProtocol', + 'DdosCustomPolicyTriggerSensitivityOverride', + 'DdosSettingsProtectionCoverage', + 'DestinationPortBehavior', + 'DhGroup', + 'Direction', + 'EffectiveRouteSource', + 'EffectiveRouteState', + 'EffectiveSecurityRuleProtocol', + 'EndpointType', + 'EvaluationState', + 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixState', + 'ExpressRouteCircuitPeeringState', + 'ExpressRouteCircuitSkuFamily', + 'ExpressRouteCircuitSkuTier', + 'ExpressRouteLinkAdminState', + 'ExpressRouteLinkConnectorType', + 'ExpressRouteLinkMacSecCipher', + 'ExpressRouteLinkMacSecSciState', + 'ExpressRoutePeeringState', + 'ExpressRoutePeeringType', + 'ExpressRoutePortsEncapsulation', + 'ExtendedLocationTypes', + 'FirewallPolicyFilterRuleCollectionActionType', + 'FirewallPolicyIntrusionDetectionProtocol', + 'FirewallPolicyIntrusionDetectionStateType', + 'FirewallPolicyNatRuleCollectionActionType', + 'FirewallPolicyRuleApplicationProtocolType', + 'FirewallPolicyRuleCollectionType', + 'FirewallPolicyRuleNetworkProtocol', + 'FirewallPolicyRuleType', + 'FirewallPolicySkuTier', + 'FlowLogFormatType', + 'HTTPConfigurationMethod', + 'HTTPMethod', + 'HubBgpConnectionStatus', + 'HubVirtualNetworkConnectionStatus', + 'IPAllocationMethod', + 'IPVersion', + 'IkeEncryption', + 'IkeIntegrity', + 'InboundSecurityRulesProtocol', + 'IpAllocationType', + 'IpFlowProtocol', + 'IpsecEncryption', + 'IpsecIntegrity', + 'IssueType', + 'LoadBalancerOutboundRuleProtocol', + 'LoadBalancerSkuName', + 'LoadBalancerSkuTier', + 'LoadDistribution', + 'ManagedRuleEnabledState', + 'NatGatewaySkuName', + 'NetworkOperationStatus', + 'NextHopType', + 'OfficeTrafficCategory', + 'Origin', + 'OutputType', + 'OwaspCrsExclusionEntryMatchVariable', + 'OwaspCrsExclusionEntrySelectorMatchOperator', + 'PcError', + 'PcProtocol', + 'PcStatus', + 'PfsGroup', + 'PreferredIPVersion', + 'ProbeProtocol', + 'ProcessorArchitecture', + 'Protocol', + 'ProtocolType', + 'ProvisioningState', + 'PublicIPAddressSkuName', + 'PublicIPAddressSkuTier', + 'PublicIPPrefixSkuName', + 'PublicIPPrefixSkuTier', + 'ResourceIdentityType', + 'RouteFilterRuleType', + 'RouteNextHopType', + 'RoutingState', + 'SecurityPartnerProviderConnectionStatus', + 'SecurityProviderName', + 'SecurityRuleAccess', + 'SecurityRuleDirection', + 'SecurityRuleProtocol', + 'ServiceProviderProvisioningState', + 'Severity', + 'TransportProtocol', + 'TunnelConnectionStatus', + 'UsageUnit', + 'VerbosityLevel', + 'VirtualNetworkGatewayConnectionMode', + 'VirtualNetworkGatewayConnectionProtocol', + 'VirtualNetworkGatewayConnectionStatus', + 'VirtualNetworkGatewayConnectionType', + 'VirtualNetworkGatewaySkuName', + 'VirtualNetworkGatewaySkuTier', + 'VirtualNetworkGatewayType', + 'VirtualNetworkPeeringState', + 'VirtualWanSecurityProviderType', + 'VpnAuthenticationType', + 'VpnClientProtocol', + 'VpnConnectionStatus', + 'VpnGatewayGeneration', + 'VpnGatewayTunnelingProtocol', + 'VpnType', + 'WebApplicationFirewallAction', + 'WebApplicationFirewallEnabledState', + 'WebApplicationFirewallMatchVariable', + 'WebApplicationFirewallMode', + 'WebApplicationFirewallOperator', + 'WebApplicationFirewallPolicyResourceState', + 'WebApplicationFirewallRuleType', + 'WebApplicationFirewallTransform', +] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_models.py new file mode 100644 index 0000000000000..cbca27ff7501a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_models.py @@ -0,0 +1,22460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AadAuthenticationParameters(msrest.serialization.Model): + """AAD Vpn authentication type related parameters. + + :param aad_tenant: AAD Vpn authentication parameter AAD tenant. + :type aad_tenant: str + :param aad_audience: AAD Vpn authentication parameter AAD audience. + :type aad_audience: str + :param aad_issuer: AAD Vpn authentication parameter AAD issuer. + :type aad_issuer: str + """ + + _attribute_map = { + 'aad_tenant': {'key': 'aadTenant', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + 'aad_issuer': {'key': 'aadIssuer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AadAuthenticationParameters, self).__init__(**kwargs) + self.aad_tenant = kwargs.get('aad_tenant', None) + self.aad_audience = kwargs.get('aad_audience', None) + self.aad_issuer = kwargs.get('aad_issuer', None) + + +class AddressSpace(msrest.serialization.Model): + """AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this virtual network in CIDR + notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) + + +class Resource(msrest.serialization.Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting where the resource needs to come from. + :type zones: list[str] + :param identity: The identity of the application gateway, if configured. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway resource. Possible values + include: "Stopped", "Starting", "Running", "Stopping". + :vartype operational_state: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of the application gateway resource. For default + limits, see `Application Gateway limits `_. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type authentication_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAuthenticationCertificate] + :param trusted_root_certificates: Trusted Root certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type trusted_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayTrustedRootCertificate] + :param trusted_client_certificates: Trusted client certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type trusted_client_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayTrustedClientCertificate] + :param ssl_certificates: SSL certificates of the application gateway resource. For default + limits, see `Application Gateway limits `_. + :type ssl_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the application gateway resource. + For default limits, see `Application Gateway limits `_. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. For default limits, + see `Application Gateway limits `_. + :type frontend_ports: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application gateway resource. For + default limits, see `Application Gateway limits `_. + :type backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. For default limits, + see `Application Gateway limits `_. + :type http_listeners: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayHttpListener] + :param ssl_profiles: SSL profiles of the application gateway resource. For default limits, see + `Application Gateway limits `_. + :type ssl_profiles: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProfile] + :param url_path_maps: URL path map of the application gateway resource. For default limits, see + `Application Gateway limits `_. + :type url_path_maps: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRequestRoutingRule] + :param rewrite_rule_sets: Rewrite rules for the application gateway resource. + :type rewrite_rule_sets: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRuleSet] + :param redirect_configurations: Redirect configurations of the application gateway resource. + For default limits, see `Application Gateway limits `_. + :type redirect_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param enable_http2: Whether HTTP2 is enabled on the application gateway resource. + :type enable_http2: bool + :param enable_fips: Whether FIPS is enabled on the application gateway resource. + :type enable_fips: bool + :param autoscale_configuration: Autoscale Configuration. + :type autoscale_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAutoscaleConfiguration + :param private_link_configurations: PrivateLink configurations on application gateway. + :type private_link_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection] + :ivar resource_guid: The resource GUID property of the application gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application gateway resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the application gateway + resource. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCustomError] + :param force_firewall_policy_association: If true, associates a firewall policy with an + application gateway regardless whether the policy differs from the WAF Config. + :type force_firewall_policy_association: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'operational_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'trusted_root_certificates': {'key': 'properties.trustedRootCertificates', 'type': '[ApplicationGatewayTrustedRootCertificate]'}, + 'trusted_client_certificates': {'key': 'properties.trustedClientCertificates', 'type': '[ApplicationGatewayTrustedClientCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'ssl_profiles': {'key': 'properties.sslProfiles', 'type': '[ApplicationGatewaySslProfile]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'rewrite_rule_sets': {'key': 'properties.rewriteRuleSets', 'type': '[ApplicationGatewayRewriteRuleSet]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + 'enable_http2': {'key': 'properties.enableHttp2', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFips', 'type': 'bool'}, + 'autoscale_configuration': {'key': 'properties.autoscaleConfiguration', 'type': 'ApplicationGatewayAutoscaleConfiguration'}, + 'private_link_configurations': {'key': 'properties.privateLinkConfigurations', 'type': '[ApplicationGatewayPrivateLinkConfiguration]'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ApplicationGatewayPrivateEndpointConnection]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'custom_error_configurations': {'key': 'properties.customErrorConfigurations', 'type': '[ApplicationGatewayCustomError]'}, + 'force_firewall_policy_association': {'key': 'properties.forceFirewallPolicyAssociation', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGateway, self).__init__(**kwargs) + self.etag = None + self.zones = kwargs.get('zones', None) + self.identity = kwargs.get('identity', None) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) + self.operational_state = None + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.trusted_root_certificates = kwargs.get('trusted_root_certificates', None) + self.trusted_client_certificates = kwargs.get('trusted_client_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.ssl_profiles = kwargs.get('ssl_profiles', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.rewrite_rule_sets = kwargs.get('rewrite_rule_sets', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.firewall_policy = kwargs.get('firewall_policy', None) + self.enable_http2 = kwargs.get('enable_http2', None) + self.enable_fips = kwargs.get('enable_fips', None) + self.autoscale_configuration = kwargs.get('autoscale_configuration', None) + self.private_link_configurations = kwargs.get('private_link_configurations', None) + self.private_endpoint_connections = None + self.resource_guid = None + self.provisioning_state = None + self.custom_error_configurations = kwargs.get('custom_error_configurations', None) + self.force_firewall_policy_association = kwargs.get('force_firewall_policy_association', None) + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the authentication certificate that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Certificate public data. + :type data: str + :ivar provisioning_state: The provisioning state of the authentication certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.data = kwargs.get('data', None) + self.provisioning_state = None + + +class ApplicationGatewayAutoscaleConfiguration(msrest.serialization.Model): + """Application Gateway autoscale configuration. + + All required parameters must be populated in order to send to Azure. + + :param min_capacity: Required. Lower bound on number of Application Gateway capacity. + :type min_capacity: int + :param max_capacity: Upper bound on number of Application Gateway capacity. + :type max_capacity: int + """ + + _validation = { + 'min_capacity': {'required': True, 'minimum': 0}, + 'max_capacity': {'minimum': 2}, + } + + _attribute_map = { + 'min_capacity': {'key': 'minCapacity', 'type': 'int'}, + 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayAutoscaleConfiguration, self).__init__(**kwargs) + self.min_capacity = kwargs['min_capacity'] + self.max_capacity = kwargs.get('max_capacity', None) + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by default to application + gateway. Possible values include: "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", + "AppGwSslPolicy20170401S". + :type default_policy: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) + + +class ApplicationGatewayAvailableSslPredefinedPolicies(msrest.serialization.Model): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + :param value: List of available Ssl predefined policy. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPredefinedPolicy] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewaySslPredefinedPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayAvailableSslPredefinedPolicies, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ApplicationGatewayAvailableWafRuleSetsResult(msrest.serialization.Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ApplicationGatewayBackendAddress(msrest.serialization.Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address. + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the backend address pool that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar backend_ip_configurations: Collection of references to IPs defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses. + :type backend_addresses: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddress] + :ivar provisioning_state: The provisioning state of the backend address pool resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'backend_ip_configurations': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.backend_ip_configurations = None + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = None + + +class ApplicationGatewayBackendHealth(msrest.serialization.Model): + """Response for ApplicationGatewayBackendHealth API service call. + + :param backend_address_pools: A list of ApplicationGatewayBackendHealthPool resources. + :type backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + + +class ApplicationGatewayBackendHealthHttpSettings(msrest.serialization.Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference to an ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) + + +class ApplicationGatewayBackendHealthOnDemand(msrest.serialization.Model): + """Result of on demand test probe. + + :param backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthHttpSettings + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_health_http_settings': {'key': 'backendHealthHttpSettings', 'type': 'ApplicationGatewayBackendHealthHttpSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendHealthOnDemand, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_health_http_settings = kwargs.get('backend_health_http_settings', None) + + +class ApplicationGatewayBackendHealthPool(msrest.serialization.Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + + +class ApplicationGatewayBackendHealthServer(msrest.serialization.Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference to IP configuration of backend server. + :type ip_configuration: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: "Unknown", "Up", "Down", + "Partial", "Draining". + :type health: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthServerHealth + :param health_probe_log: Health Probe Log. + :type health_probe_log: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + 'health_probe_log': {'key': 'healthProbeLog', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) + self.health_probe_log = kwargs.get('health_probe_log', None) + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the backend http settings that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param port: The destination port on the backend. + :type port: int + :param protocol: The protocol used to communicate with the backend. Possible values include: + "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values include: "Enabled", + "Disabled". + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway will fail the request + if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 + seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param authentication_certificates: Array of references to application gateway authentication + certificates. + :type authentication_certificates: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param trusted_root_certificates: Array of references to application gateway trusted root + certificates. + :type trusted_root_certificates: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param connection_draining: Connection draining of the backend http settings resource. + :type connection_draining: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header should be picked from + the host name of the backend server. Default value is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. Null means no path + will be prefixed. Default value is null. + :type path: str + :ivar provisioning_state: The provisioning state of the backend HTTP settings resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'trusted_root_certificates': {'key': 'properties.trustedRootCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.trusted_root_certificates = kwargs.get('trusted_root_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = None + + +class ApplicationGatewayClientAuthConfiguration(msrest.serialization.Model): + """Application gateway client authentication configuration. + + :param verify_client_cert_issuer_dn: Verify client certificate issuer name on the application + gateway. + :type verify_client_cert_issuer_dn: bool + """ + + _attribute_map = { + 'verify_client_cert_issuer_dn': {'key': 'verifyClientCertIssuerDN', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayClientAuthConfiguration, self).__init__(**kwargs) + self.verify_client_cert_issuer_dn = kwargs.get('verify_client_cert_issuer_dn', None) + + +class ApplicationGatewayConnectionDraining(msrest.serialization.Model): + """Connection draining allows open connections to a backend server to be active for a specified time after the backend server got removed from the configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection draining is active. + Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.drain_timeout_in_sec = kwargs['drain_timeout_in_sec'] + + +class ApplicationGatewayCustomError(msrest.serialization.Model): + """Customer error of an application gateway. + + :param status_code: Status code of the application gateway customer error. Possible values + include: "HttpStatus403", "HttpStatus502". + :type status_code: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCustomErrorStatusCode + :param custom_error_page_url: Error page URL of the application gateway customer error. + :type custom_error_page_url: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'custom_error_page_url': {'key': 'customErrorPageUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayCustomError, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.custom_error_page_url = kwargs.get('custom_error_page_url', None) + + +class ApplicationGatewayFirewallDisabledRuleGroup(msrest.serialization.Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules of the rule group + will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs['rule_group_name'] + self.rules = kwargs.get('rules', None) + + +class ApplicationGatewayFirewallExclusion(msrest.serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. The variable to be excluded. + :type match_variable: str + :param selector_match_operator: Required. When matchVariable is a collection, operate on the + selector to specify which elements in the collection this exclusion applies to. + :type selector_match_operator: str + :param selector: Required. When matchVariable is a collection, operator used to specify which + elements in the collection this exclusion applies to. + :type selector: str + """ + + _validation = { + 'match_variable': {'required': True}, + 'selector_match_operator': {'required': True}, + 'selector': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector_match_operator': {'key': 'selectorMatchOperator', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFirewallExclusion, self).__init__(**kwargs) + self.match_variable = kwargs['match_variable'] + self.selector_match_operator = kwargs['selector_match_operator'] + self.selector = kwargs['selector'] + + +class ApplicationGatewayFirewallRule(msrest.serialization.Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs['rule_id'] + self.description = kwargs.get('description', None) + + +class ApplicationGatewayFirewallRuleGroup(msrest.serialization.Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule group. + :type description: str + :param rules: Required. The rules of the web application firewall rule group. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs['rule_group_name'] + self.description = kwargs.get('description', None) + self.rules = kwargs['rules'] + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the web application firewall rule set. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param rule_set_type: The type of the web application firewall rule set. + :type rule_set_type: str + :param rule_set_version: The version of the web application firewall rule set type. + :type rule_set_version: str + :param rule_groups: The rule groups of the web application firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = None + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the frontend IP configuration that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param private_ip_address: PrivateIPAddress of the network interface IP Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param private_link_configuration: Reference to the application gateway private link + configuration. + :type private_link_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the frontend IP configuration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'private_link_configuration': {'key': 'properties.privateLinkConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.private_link_configuration = kwargs.get('private_link_configuration', None) + self.provisioning_state = None + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the frontend port that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param port: Frontend port. + :type port: int + :ivar provisioning_state: The provisioning state of the frontend port resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.port = kwargs.get('port', None) + self.provisioning_state = None + + +class ApplicationGatewayHeaderConfiguration(msrest.serialization.Model): + """Header configuration of the Actions set in Application Gateway. + + :param header_name: Header name of the header configuration. + :type header_name: str + :param header_value: Header value of the header configuration. + :type header_value: str + """ + + _attribute_map = { + 'header_name': {'key': 'headerName', 'type': 'str'}, + 'header_value': {'key': 'headerValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayHeaderConfiguration, self).__init__(**kwargs) + self.header_name = kwargs.get('header_name', None) + self.header_value = kwargs.get('header_value', None) + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the HTTP listener that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: Frontend IP configuration resource of an application gateway. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protocol: Protocol of the HTTP listener. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application gateway. + :type ssl_certificate: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param ssl_profile: SSL profile resource of the application gateway. + :type ssl_profile: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is https. Enables SNI for + multi-hosting. + :type require_server_name_indication: bool + :ivar provisioning_state: The provisioning state of the HTTP listener resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the HTTP listener. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCustomError] + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param host_names: List of Host names for HTTP Listener that allows special wildcard characters + as well. + :type host_names: list[str] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'ssl_profile': {'key': 'properties.sslProfile', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'custom_error_configurations': {'key': 'properties.customErrorConfigurations', 'type': '[ApplicationGatewayCustomError]'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.ssl_profile = kwargs.get('ssl_profile', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = None + self.custom_error_configurations = kwargs.get('custom_error_configurations', None) + self.firewall_policy = kwargs.get('firewall_policy', None) + self.host_names = kwargs.get('host_names', None) + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the IP configuration that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param subnet: Reference to the subnet resource. A subnet from where application gateway gets + its private address. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the application gateway IP configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = None + + +class ApplicationGatewayListResult(msrest.serialization.Model): + """Response for ListApplicationGateways API service call. + + :param value: List of an application gateways in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGateway] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ApplicationGatewayOnDemandProbe(msrest.serialization.Model): + """Details of on demand test probe request. + + :param protocol: The protocol used for the probe. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :type path: str + :param timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :type timeout: int + :param pick_host_name_from_backend_http_settings: Whether the host header should be picked from + the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param match: Criterion for classifying a healthy probe response. + :type match: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProbeHealthResponseMatch + :param backend_address_pool: Reference to backend pool of application gateway to which probe + request will be sent. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_http_settings: Reference to backend http setting of application gateway to be + used for test probe. + :type backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'match': {'key': 'match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayOnDemandProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.timeout = kwargs.get('timeout', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.match = kwargs.get('match', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the path rule that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map path rule. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path map path rule. + :type backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path map path rule. + :type redirect_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param rewrite_rule_set: Rewrite rule set resource of URL path map path rule. + :type rewrite_rule_set: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the path rule resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'rewrite_rule_set': {'key': 'properties.rewriteRuleSet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.rewrite_rule_set = kwargs.get('rewrite_rule_set', None) + self.provisioning_state = None + self.firewall_policy = kwargs.get('firewall_policy', None) + + +class ApplicationGatewayPrivateEndpointConnection(SubResource): + """Private Endpoint connection on an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the private endpoint connection on an application gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the application gateway private endpoint + connection resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar link_identifier: The consumer link id. + :vartype link_identifier: str + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'private_endpoint': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'link_identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'link_identifier': {'key': 'properties.linkIdentifier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPrivateEndpointConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.private_endpoint = None + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + self.link_identifier = None + + +class ApplicationGatewayPrivateEndpointConnectionListResult(msrest.serialization.Model): + """Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections for an application gateway. + + :param value: List of private endpoint connections on an application gateway. + :type value: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayPrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ApplicationGatewayPrivateLinkConfiguration(SubResource): + """Private Link Configuration on an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the private link configuration that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param ip_configurations: An array of application gateway private link ip configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkIpConfiguration] + :ivar provisioning_state: The provisioning state of the application gateway private link + configuration. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[ApplicationGatewayPrivateLinkIpConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPrivateLinkConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.ip_configurations = kwargs.get('ip_configurations', None) + self.provisioning_state = None + + +class ApplicationGatewayPrivateLinkIpConfiguration(SubResource): + """The application gateway private link ip configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of application gateway private link ip configuration. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param primary: Whether the ip configuration is primary or not. + :type primary: bool + :ivar provisioning_state: The provisioning state of the application gateway private link IP + configuration. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPrivateLinkIpConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.provisioning_state = None + + +class ApplicationGatewayPrivateLinkResource(SubResource): + """PrivateLink Resource of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the private link resource that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar group_id: Group identifier of private link resource. + :vartype group_id: str + :ivar required_members: Required member names of private link resource. + :vartype required_members: list[str] + :param required_zone_names: Required DNS zone names of the the private link resource. + :type required_zone_names: list[str] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPrivateLinkResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class ApplicationGatewayPrivateLinkResourceListResult(msrest.serialization.Model): + """Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an application gateway. + + :param value: List of private link resources of an application gateway. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkResource] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayPrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayPrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the probe that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param protocol: The protocol used for the probe. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :type path: str + :param interval: The probing interval in seconds. This is the time interval between two + consecutive probes. Acceptable values are from 1 second to 86400 seconds. + :type interval: int + :param timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is marked down after + consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second + to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header should be picked from + the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked healthy. Default value is + 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProbeHealthResponseMatch + :ivar provisioning_state: The provisioning state of the probe resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param port: Custom port which will be used for probing the backend servers. The valid value + ranges from 1 to 65535. In case not set, port from http settings will be used. This property is + valid for Standard_v2 and WAF_v2 only. + :type port: int + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'port': {'maximum': 65535, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = None + self.port = kwargs.get('port', None) + + +class ApplicationGatewayProbeHealthResponseMatch(msrest.serialization.Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range of healthy status + codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the redirect configuration that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param redirect_type: HTTP redirection type. Possible values include: "Permanent", "Found", + "SeeOther", "Temporary". + :type redirect_type: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request to. + :type target_listener: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect configuration. + :type request_routing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect configuration. + :type url_path_maps: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the request routing rule that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param rule_type: Rule type. Possible values include: "Basic", "PathBasedRouting". + :type rule_type: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRequestRoutingRuleType + :param priority: Priority of the request routing rule. + :type priority: int + :param backend_address_pool: Backend address pool resource of the application gateway. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_http_settings: Backend http settings resource of the application gateway. + :type backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param rewrite_rule_set: Rewrite Rule Set resource in Basic rule of the application gateway. + :type rewrite_rule_set: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the application gateway. + :type redirect_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the request routing rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'priority': {'maximum': 20000, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'rewrite_rule_set': {'key': 'properties.rewriteRuleSet', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.rule_type = kwargs.get('rule_type', None) + self.priority = kwargs.get('priority', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.rewrite_rule_set = kwargs.get('rewrite_rule_set', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = None + + +class ApplicationGatewayRewriteRule(msrest.serialization.Model): + """Rewrite rule of an application gateway. + + :param name: Name of the rewrite rule that is unique within an Application Gateway. + :type name: str + :param rule_sequence: Rule Sequence of the rewrite rule that determines the order of execution + of a particular rule in a RewriteRuleSet. + :type rule_sequence: int + :param conditions: Conditions based on which the action set execution will be evaluated. + :type conditions: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRuleCondition] + :param action_set: Set of actions to be done as part of the rewrite Rule. + :type action_set: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRuleActionSet + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'rule_sequence': {'key': 'ruleSequence', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[ApplicationGatewayRewriteRuleCondition]'}, + 'action_set': {'key': 'actionSet', 'type': 'ApplicationGatewayRewriteRuleActionSet'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayRewriteRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.rule_sequence = kwargs.get('rule_sequence', None) + self.conditions = kwargs.get('conditions', None) + self.action_set = kwargs.get('action_set', None) + + +class ApplicationGatewayRewriteRuleActionSet(msrest.serialization.Model): + """Set of actions in the Rewrite Rule in Application Gateway. + + :param request_header_configurations: Request Header Actions in the Action Set. + :type request_header_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayHeaderConfiguration] + :param response_header_configurations: Response Header Actions in the Action Set. + :type response_header_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayHeaderConfiguration] + :param url_configuration: Url Configuration Action in the Action Set. + :type url_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayUrlConfiguration + """ + + _attribute_map = { + 'request_header_configurations': {'key': 'requestHeaderConfigurations', 'type': '[ApplicationGatewayHeaderConfiguration]'}, + 'response_header_configurations': {'key': 'responseHeaderConfigurations', 'type': '[ApplicationGatewayHeaderConfiguration]'}, + 'url_configuration': {'key': 'urlConfiguration', 'type': 'ApplicationGatewayUrlConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayRewriteRuleActionSet, self).__init__(**kwargs) + self.request_header_configurations = kwargs.get('request_header_configurations', None) + self.response_header_configurations = kwargs.get('response_header_configurations', None) + self.url_configuration = kwargs.get('url_configuration', None) + + +class ApplicationGatewayRewriteRuleCondition(msrest.serialization.Model): + """Set of conditions in the Rewrite Rule in Application Gateway. + + :param variable: The condition parameter of the RewriteRuleCondition. + :type variable: str + :param pattern: The pattern, either fixed string or regular expression, that evaluates the + truthfulness of the condition. + :type pattern: str + :param ignore_case: Setting this paramter to truth value with force the pattern to do a case + in-sensitive comparison. + :type ignore_case: bool + :param negate: Setting this value as truth will force to check the negation of the condition + given by the user. + :type negate: bool + """ + + _attribute_map = { + 'variable': {'key': 'variable', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, + 'negate': {'key': 'negate', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayRewriteRuleCondition, self).__init__(**kwargs) + self.variable = kwargs.get('variable', None) + self.pattern = kwargs.get('pattern', None) + self.ignore_case = kwargs.get('ignore_case', None) + self.negate = kwargs.get('negate', None) + + +class ApplicationGatewayRewriteRuleSet(SubResource): + """Rewrite rule set of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the rewrite rule set that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param rewrite_rules: Rewrite rules in the rewrite rule set. + :type rewrite_rules: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRule] + :ivar provisioning_state: The provisioning state of the rewrite rule set resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'rewrite_rules': {'key': 'properties.rewriteRules', 'type': '[ApplicationGatewayRewriteRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayRewriteRuleSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.rewrite_rules = kwargs.get('rewrite_rules', None) + self.provisioning_state = None + + +class ApplicationGatewaySku(msrest.serialization.Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: "Standard_Small", + "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large", "Standard_v2", "WAF_v2". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: "Standard", "WAF", + "Standard_v2", "WAF_v2". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the SSL certificate that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT Request. + :type data: str + :param password: Password for the pfx file specified in data. Only applicable in PUT request. + :type password: str + :ivar public_cert_data: Base-64 encoded Public cert data corresponding to pfx specified in + data. Only applicable in GET request. + :vartype public_cert_data: str + :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :type key_vault_secret_id: str + :ivar provisioning_state: The provisioning state of the SSL certificate resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'public_cert_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = None + self.key_vault_secret_id = kwargs.get('key_vault_secret_id', None) + self.provisioning_state = None + + +class ApplicationGatewaySslPolicy(msrest.serialization.Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". + :type policy_type: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values include: + "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S". + :type policy_name: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified order to application + gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". + :type min_protocol_version: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of the Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified order for application + gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". + :type min_protocol_version: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) + + +class ApplicationGatewaySslProfile(SubResource): + """SSL profile of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the SSL profile that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param trusted_client_certificates: Array of references to application gateway trusted client + certificates. + :type trusted_client_certificates: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicy + :param client_auth_configuration: Client authentication configuration of the application + gateway resource. + :type client_auth_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayClientAuthConfiguration + :ivar provisioning_state: The provisioning state of the HTTP listener resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'trusted_client_certificates': {'key': 'properties.trustedClientCertificates', 'type': '[SubResource]'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'client_auth_configuration': {'key': 'properties.clientAuthConfiguration', 'type': 'ApplicationGatewayClientAuthConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewaySslProfile, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.trusted_client_certificates = kwargs.get('trusted_client_certificates', None) + self.ssl_policy = kwargs.get('ssl_policy', None) + self.client_auth_configuration = kwargs.get('client_auth_configuration', None) + self.provisioning_state = None + + +class ApplicationGatewayTrustedClientCertificate(SubResource): + """Trusted client certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the trusted client certificate that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Certificate public data. + :type data: str + :ivar provisioning_state: The provisioning state of the trusted client certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayTrustedClientCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.data = kwargs.get('data', None) + self.provisioning_state = None + + +class ApplicationGatewayTrustedRootCertificate(SubResource): + """Trusted Root certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the trusted root certificate that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Certificate public data. + :type data: str + :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :type key_vault_secret_id: str + :ivar provisioning_state: The provisioning state of the trusted root certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayTrustedRootCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.data = kwargs.get('data', None) + self.key_vault_secret_id = kwargs.get('key_vault_secret_id', None) + self.provisioning_state = None + + +class ApplicationGatewayUrlConfiguration(msrest.serialization.Model): + """Url configuration of the Actions set in Application Gateway. + + :param modified_path: Url path which user has provided for url rewrite. Null means no path will + be updated. Default value is null. + :type modified_path: str + :param modified_query_string: Query string which user has provided for url rewrite. Null means + no query string will be updated. Default value is null. + :type modified_query_string: str + :param reroute: If set as true, it will re-evaluate the url path map provided in path based + request routing rules using modified path. Default value is false. + :type reroute: bool + """ + + _attribute_map = { + 'modified_path': {'key': 'modifiedPath', 'type': 'str'}, + 'modified_query_string': {'key': 'modifiedQueryString', 'type': 'str'}, + 'reroute': {'key': 'reroute', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayUrlConfiguration, self).__init__(**kwargs) + self.modified_path = kwargs.get('modified_path', None) + self.modified_query_string = kwargs.get('modified_query_string', None) + self.reroute = kwargs.get('reroute', None) + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the URL path map that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param default_backend_address_pool: Default backend address pool resource of URL path map. + :type default_backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param default_backend_http_settings: Default backend http settings resource of URL path map. + :type default_backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param default_rewrite_rule_set: Default Rewrite rule set resource of URL path map. + :type default_rewrite_rule_set: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration resource of URL path map. + :type default_redirect_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPathRule] + :ivar provisioning_state: The provisioning state of the URL path map resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_rewrite_rule_set': {'key': 'properties.defaultRewriteRuleSet', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_rewrite_rule_set = kwargs.get('default_rewrite_rule_set', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = None + + +class ApplicationGatewayWebApplicationFirewallConfiguration(msrest.serialization.Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible values include: + "Detection", "Prevention". + :type firewall_mode: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall rule set. Possible + values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + :param request_body_check: Whether allow WAF to check request Body. + :type request_body_check: bool + :param max_request_body_size: Maximum request body size for WAF. + :type max_request_body_size: int + :param max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :type max_request_body_size_in_kb: int + :param file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :type file_upload_limit_in_mb: int + :param exclusions: The exclusion list. + :type exclusions: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallExclusion] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'max_request_body_size': {'maximum': 128, 'minimum': 8}, + 'max_request_body_size_in_kb': {'maximum': 128, 'minimum': 8}, + 'file_upload_limit_in_mb': {'minimum': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'bool'}, + 'max_request_body_size': {'key': 'maxRequestBodySize', 'type': 'int'}, + 'max_request_body_size_in_kb': {'key': 'maxRequestBodySizeInKb', 'type': 'int'}, + 'file_upload_limit_in_mb': {'key': 'fileUploadLimitInMb', 'type': 'int'}, + 'exclusions': {'key': 'exclusions', 'type': '[ApplicationGatewayFirewallExclusion]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.firewall_mode = kwargs['firewall_mode'] + self.rule_set_type = kwargs['rule_set_type'] + self.rule_set_version = kwargs['rule_set_version'] + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) + self.request_body_check = kwargs.get('request_body_check', None) + self.max_request_body_size = kwargs.get('max_request_body_size', None) + self.max_request_body_size_in_kb = kwargs.get('max_request_body_size_in_kb', None) + self.file_upload_limit_in_mb = kwargs.get('file_upload_limit_in_mb', None) + self.exclusions = kwargs.get('exclusions', None) + + +class FirewallPolicyRule(msrest.serialization.Model): + """Properties of a rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ApplicationRule, NatRule, NetworkRule. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + _subtype_map = { + 'rule_type': {'ApplicationRule': 'ApplicationRule', 'NatRule': 'NatRule', 'NetworkRule': 'NetworkRule'} + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.rule_type = None # type: Optional[str] + + +class ApplicationRule(FirewallPolicyRule): + """Rule of type application. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or Service Tags. + :type destination_addresses: list[str] + :param protocols: Array of Application Protocols. + :type protocols: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleApplicationProtocol] + :param target_fqdns: List of FQDNs for this rule. + :type target_fqdns: list[str] + :param target_urls: List of Urls for this rule condition. + :type target_urls: list[str] + :param fqdn_tags: List of FQDN Tags for this rule. + :type fqdn_tags: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param terminate_tls: Terminate TLS connections for this rule. + :type terminate_tls: bool + :param web_categories: List of destination azure web categories. + :type web_categories: list[str] + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[FirewallPolicyRuleApplicationProtocol]'}, + 'target_fqdns': {'key': 'targetFqdns', 'type': '[str]'}, + 'target_urls': {'key': 'targetUrls', 'type': '[str]'}, + 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'terminate_tls': {'key': 'terminateTLS', 'type': 'bool'}, + 'web_categories': {'key': 'webCategories', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationRule, self).__init__(**kwargs) + self.rule_type = 'ApplicationRule' # type: str + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.protocols = kwargs.get('protocols', None) + self.target_fqdns = kwargs.get('target_fqdns', None) + self.target_urls = kwargs.get('target_urls', None) + self.fqdn_tags = kwargs.get('fqdn_tags', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + self.terminate_tls = kwargs.get('terminate_tls', None) + self.web_categories = kwargs.get('web_categories', None) + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the application security group resource. It + uniquely identifies a resource, even if the user changes its name or migrate the resource + across subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application security group resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationSecurityGroup, self).__init__(**kwargs) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + + +class ApplicationSecurityGroupListResult(msrest.serialization.Model): + """A list of application security groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of application security groups. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AuthorizationListResult(msrest.serialization.Model): + """Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + + :param value: The authorizations in an ExpressRoute Circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthorizationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class AutoApprovedPrivateLinkService(msrest.serialization.Model): + """The information of an AutoApprovedPrivateLinkService. + + :param private_link_service: The id of the private link service resource. + :type private_link_service: str + """ + + _attribute_map = { + 'private_link_service': {'key': 'privateLinkService', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoApprovedPrivateLinkService, self).__init__(**kwargs) + self.private_link_service = kwargs.get('private_link_service', None) + + +class AutoApprovedPrivateLinkServicesResult(msrest.serialization.Model): + """An array of private link service id that can be linked to a private end point with auto approved. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of auto approved private link service. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AutoApprovedPrivateLinkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AutoApprovedPrivateLinkService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoApprovedPrivateLinkServicesResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Availability(msrest.serialization.Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Availability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class AvailableDelegation(msrest.serialization.Model): + """The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. + + :param name: The name of the AvailableDelegation resource. + :type name: str + :param id: A unique identifier of the AvailableDelegation resource. + :type id: str + :param type: Resource type. + :type type: str + :param service_name: The name of the service and resource. + :type service_name: str + :param actions: The actions permitted to the service upon delegation. + :type actions: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableDelegation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.service_name = kwargs.get('service_name', None) + self.actions = kwargs.get('actions', None) + + +class AvailableDelegationsResult(msrest.serialization.Model): + """An array of available delegations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of available delegations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AvailableDelegation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailableDelegation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableDelegationsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AvailablePrivateEndpointType(msrest.serialization.Model): + """The information of an AvailablePrivateEndpointType. + + :param name: The name of the service and resource. + :type name: str + :param id: A unique identifier of the AvailablePrivateEndpoint Type resource. + :type id: str + :param type: Resource type. + :type type: str + :param resource_name: The name of the service and resource. + :type resource_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailablePrivateEndpointType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.resource_name = kwargs.get('resource_name', None) + + +class AvailablePrivateEndpointTypesResult(msrest.serialization.Model): + """An array of available PrivateEndpoint types. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of available privateEndpoint type. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AvailablePrivateEndpointType] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailablePrivateEndpointType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailablePrivateEndpointTypesResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AvailableProvidersList(msrest.serialization.Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: list[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = kwargs['countries'] + + +class AvailableProvidersListCity(msrest.serialization.Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = kwargs.get('city_name', None) + self.providers = kwargs.get('providers', None) + + +class AvailableProvidersListCountry(msrest.serialization.Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: list[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = kwargs.get('country_name', None) + self.providers = kwargs.get('providers', None) + self.states = kwargs.get('states', None) + + +class AvailableProvidersListParameters(msrest.serialization.Model): + """Constraints that determine the list of available Internet service providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = kwargs.get('azure_locations', None) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) + + +class AvailableProvidersListState(msrest.serialization.Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: list[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = kwargs.get('state_name', None) + self.providers = kwargs.get('providers', None) + self.cities = kwargs.get('cities', None) + + +class AvailableServiceAlias(msrest.serialization.Model): + """The available service alias. + + :param name: The name of the service alias. + :type name: str + :param id: The ID of the service alias. + :type id: str + :param type: The type of the resource. + :type type: str + :param resource_name: The resource name of the service alias. + :type resource_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableServiceAlias, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.resource_name = kwargs.get('resource_name', None) + + +class AvailableServiceAliasesResult(msrest.serialization.Model): + """An array of available service aliases. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of available service aliases. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AvailableServiceAlias] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailableServiceAlias]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableServiceAliasesResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AzureAsyncOperationResult(msrest.serialization.Model): + """The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information regarding the failure. + + :param status: Status of the Azure async operation. Possible values include: "InProgress", + "Succeeded", "Failed". + :type status: str or ~azure.mgmt.network.v2020_07_01.models.NetworkOperationStatus + :param error: Details of the error occurred during specified asynchronous operation. + :type error: ~azure.mgmt.network.v2020_07_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class AzureFirewall(Resource): + """Azure Firewall resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param zones: A list of availability zones denoting where the resource needs to come from. + :type zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param application_rule_collections: Collection of application rule collections used by Azure + Firewall. + :type application_rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRuleCollection] + :param nat_rule_collections: Collection of NAT rule collections used by Azure Firewall. + :type nat_rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRuleCollection] + :param network_rule_collections: Collection of network rule collections used by Azure Firewall. + :type network_rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallIPConfiguration] + :param management_ip_configuration: IP configuration of the Azure Firewall used for management + traffic. + :type management_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallIPConfiguration + :ivar provisioning_state: The provisioning state of the Azure firewall resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param threat_intel_mode: The operation mode for Threat Intelligence. Possible values include: + "Alert", "Deny", "Off". + :type threat_intel_mode: str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallThreatIntelMode + :param virtual_hub: The virtualHub to which the firewall belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param firewall_policy: The firewallPolicy associated with this azure firewall. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param hub_ip_addresses: IP addresses associated with AzureFirewall. + :type hub_ip_addresses: ~azure.mgmt.network.v2020_07_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallIpGroups] + :param sku: The Azure Firewall Resource SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallSku + :param additional_properties: The additional properties used to further config this azure + firewall. + :type additional_properties: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'ip_groups': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'application_rule_collections': {'key': 'properties.applicationRuleCollections', 'type': '[AzureFirewallApplicationRuleCollection]'}, + 'nat_rule_collections': {'key': 'properties.natRuleCollections', 'type': '[AzureFirewallNatRuleCollection]'}, + 'network_rule_collections': {'key': 'properties.networkRuleCollections', 'type': '[AzureFirewallNetworkRuleCollection]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[AzureFirewallIPConfiguration]'}, + 'management_ip_configuration': {'key': 'properties.managementIpConfiguration', 'type': 'AzureFirewallIPConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + 'hub_ip_addresses': {'key': 'properties.hubIPAddresses', 'type': 'HubIPAddresses'}, + 'ip_groups': {'key': 'properties.ipGroups', 'type': '[AzureFirewallIpGroups]'}, + 'sku': {'key': 'properties.sku', 'type': 'AzureFirewallSku'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewall, self).__init__(**kwargs) + self.zones = kwargs.get('zones', None) + self.etag = None + self.application_rule_collections = kwargs.get('application_rule_collections', None) + self.nat_rule_collections = kwargs.get('nat_rule_collections', None) + self.network_rule_collections = kwargs.get('network_rule_collections', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.management_ip_configuration = kwargs.get('management_ip_configuration', None) + self.provisioning_state = None + self.threat_intel_mode = kwargs.get('threat_intel_mode', None) + self.virtual_hub = kwargs.get('virtual_hub', None) + self.firewall_policy = kwargs.get('firewall_policy', None) + self.hub_ip_addresses = kwargs.get('hub_ip_addresses', None) + self.ip_groups = None + self.sku = kwargs.get('sku', None) + self.additional_properties = kwargs.get('additional_properties', None) + + +class AzureFirewallApplicationRule(msrest.serialization.Model): + """Properties of an application rule. + + :param name: Name of the application rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param protocols: Array of ApplicationRuleProtocols. + :type protocols: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRuleProtocol] + :param target_fqdns: List of FQDNs for this rule. + :type target_fqdns: list[str] + :param fqdn_tags: List of FQDN Tags for this rule. + :type fqdn_tags: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[AzureFirewallApplicationRuleProtocol]'}, + 'target_fqdns': {'key': 'targetFqdns', 'type': '[str]'}, + 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallApplicationRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.protocols = kwargs.get('protocols', None) + self.target_fqdns = kwargs.get('target_fqdns', None) + self.fqdn_tags = kwargs.get('fqdn_tags', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + + +class AzureFirewallApplicationRuleCollection(SubResource): + """Application rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Priority of the application rule collection resource. + :type priority: int + :param action: The action type of a rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRule] + :ivar provisioning_state: The provisioning state of the application rule collection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallApplicationRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallApplicationRuleCollection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.priority = kwargs.get('priority', None) + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + self.provisioning_state = None + + +class AzureFirewallApplicationRuleProtocol(msrest.serialization.Model): + """Properties of the application rule protocol. + + :param protocol_type: Protocol type. Possible values include: "Http", "Https", "Mssql". + :type protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRuleProtocolType + :param port: Port number for the protocol, cannot be greater than 64000. This field is + optional. + :type port: int + """ + + _validation = { + 'port': {'maximum': 64000, 'minimum': 0}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallApplicationRuleProtocol, self).__init__(**kwargs) + self.protocol_type = kwargs.get('protocol_type', None) + self.port = kwargs.get('port', None) + + +class AzureFirewallFqdnTag(Resource): + """Azure Firewall FQDN Tag Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the Azure firewall FQDN tag resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar fqdn_tag_name: The name of this FQDN Tag. + :vartype fqdn_tag_name: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'fqdn_tag_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'fqdn_tag_name': {'key': 'properties.fqdnTagName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallFqdnTag, self).__init__(**kwargs) + self.etag = None + self.provisioning_state = None + self.fqdn_tag_name = None + + +class AzureFirewallFqdnTagListResult(msrest.serialization.Model): + """Response for ListAzureFirewallFqdnTags API service call. + + :param value: List of Azure Firewall FQDN Tags in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallFqdnTag] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureFirewallFqdnTag]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallFqdnTagListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class AzureFirewallIPConfiguration(SubResource): + """IP configuration of an Azure Firewall. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_ip_address: The Firewall Internal Load Balancer IP to be used as the next hop in + User Defined Routes. + :vartype private_ip_address: str + :param subnet: Reference to the subnet resource. This resource must be named + 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. This field is a mandatory input + if subnet is not null. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the Azure firewall IP configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.private_ip_address = None + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = None + + +class AzureFirewallIpGroups(msrest.serialization.Model): + """IpGroups associated with azure firewall. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar change_number: The iteration number. + :vartype change_number: str + """ + + _validation = { + 'id': {'readonly': True}, + 'change_number': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'change_number': {'key': 'changeNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallIpGroups, self).__init__(**kwargs) + self.id = None + self.change_number = None + + +class AzureFirewallListResult(msrest.serialization.Model): + """Response for ListAzureFirewalls API service call. + + :param value: List of Azure Firewalls in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewall] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureFirewall]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class AzureFirewallNatRCAction(msrest.serialization.Model): + """AzureFirewall NAT Rule Collection Action. + + :param type: The type of action. Possible values include: "Snat", "Dnat". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRCActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallNatRCAction, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class AzureFirewallNatRule(msrest.serialization.Model): + """Properties of a NAT rule. + + :param name: Name of the NAT rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses for this rule. Supports IP + ranges, prefixes, and service tags. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param protocols: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + :type protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRuleProtocol] + :param translated_address: The translated address for this NAT rule. + :type translated_address: str + :param translated_port: The translated port for this NAT rule. + :type translated_port: str + :param translated_fqdn: The translated FQDN for this NAT rule. + :type translated_fqdn: str + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, + 'translated_address': {'key': 'translatedAddress', 'type': 'str'}, + 'translated_port': {'key': 'translatedPort', 'type': 'str'}, + 'translated_fqdn': {'key': 'translatedFqdn', 'type': 'str'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallNatRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.destination_ports = kwargs.get('destination_ports', None) + self.protocols = kwargs.get('protocols', None) + self.translated_address = kwargs.get('translated_address', None) + self.translated_port = kwargs.get('translated_port', None) + self.translated_fqdn = kwargs.get('translated_fqdn', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + + +class AzureFirewallNatRuleCollection(SubResource): + """NAT rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Priority of the NAT rule collection resource. + :type priority: int + :param action: The action type of a NAT rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRCAction + :param rules: Collection of rules used by a NAT rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRule] + :ivar provisioning_state: The provisioning state of the NAT rule collection resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallNatRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallNatRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallNatRuleCollection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.priority = kwargs.get('priority', None) + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + self.provisioning_state = None + + +class AzureFirewallNetworkRule(msrest.serialization.Model): + """Properties of the network rule. + + :param name: Name of the network rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param protocols: Array of AzureFirewallNetworkRuleProtocols. + :type protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRuleProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param destination_fqdns: List of destination FQDNs. + :type destination_fqdns: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param destination_ip_groups: List of destination IpGroups for this rule. + :type destination_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'destination_fqdns': {'key': 'destinationFqdns', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'destination_ip_groups': {'key': 'destinationIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallNetworkRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.protocols = kwargs.get('protocols', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.destination_ports = kwargs.get('destination_ports', None) + self.destination_fqdns = kwargs.get('destination_fqdns', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + self.destination_ip_groups = kwargs.get('destination_ip_groups', None) + + +class AzureFirewallNetworkRuleCollection(SubResource): + """Network rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Priority of the network rule collection resource. + :type priority: int + :param action: The action type of a rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRule] + :ivar provisioning_state: The provisioning state of the network rule collection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallNetworkRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallNetworkRuleCollection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.priority = kwargs.get('priority', None) + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + self.provisioning_state = None + + +class AzureFirewallPublicIPAddress(msrest.serialization.Model): + """Public IP Address associated with azure firewall. + + :param address: Public IP Address value. + :type address: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallPublicIPAddress, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + + +class AzureFirewallRCAction(msrest.serialization.Model): + """Properties of the AzureFirewallRCAction. + + :param type: The type of action. Possible values include: "Allow", "Deny". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallRCActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallRCAction, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class AzureFirewallSku(msrest.serialization.Model): + """SKU of an Azure Firewall. + + :param name: Name of an Azure Firewall SKU. Possible values include: "AZFW_VNet", "AZFW_Hub". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallSkuName + :param tier: Tier of an Azure Firewall. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class AzureReachabilityReport(msrest.serialization.Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure reachability report. Can be + Country, State or City. + :type aggregation_level: str + :param provider_location: Required. Parameters that define a geographic location. + :type provider_location: ~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report items. + :type reachability_report: + list[~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = kwargs['aggregation_level'] + self.provider_location = kwargs['provider_location'] + self.reachability_report = kwargs['reachability_report'] + + +class AzureReachabilityReportItem(msrest.serialization.Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.azure_location = kwargs.get('azure_location', None) + self.latencies = kwargs.get('latencies', None) + + +class AzureReachabilityReportLatencyInfo(msrest.serialization.Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: ~datetime.datetime + :param score: The relative latency score between 1 and 100, higher values indicating a faster + connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = kwargs.get('time_stamp', None) + self.score = kwargs.get('score', None) + + +class AzureReachabilityReportLocation(msrest.serialization.Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = kwargs['country'] + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) + + +class AzureReachabilityReportParameters(msrest.serialization.Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. Parameters that define a geographic location. + :type provider_location: ~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability report. + :type start_time: ~datetime.datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: ~datetime.datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = kwargs['provider_location'] + self.providers = kwargs.get('providers', None) + self.azure_locations = kwargs.get('azure_locations', None) + self.start_time = kwargs['start_time'] + self.end_time = kwargs['end_time'] + + +class AzureWebCategory(msrest.serialization.Model): + """Azure Web Category Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar group: The name of the group that the category belongs to. + :vartype group: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'group': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'group': {'key': 'properties.group', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWebCategory, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + self.etag = None + self.group = None + + +class AzureWebCategoryListResult(msrest.serialization.Model): + """Response for ListAzureWebCategories API service call. + + :param value: List of Azure Web Categories for a given Subscription. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AzureWebCategory] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureWebCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWebCategoryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of backend address pools + used by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param load_balancer_backend_addresses: An array of backend addresses. + :type load_balancer_backend_addresses: + list[~azure.mgmt.network.v2020_07_01.models.LoadBalancerBackendAddress] + :ivar backend_ip_configurations: An array of references to IP addresses defined in network + interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: An array of references to load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar outbound_rule: A reference to an outbound rule that uses this backend address pool. + :vartype outbound_rule: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar outbound_rules: An array of references to outbound rules that use this backend address + pool. + :vartype outbound_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the backend address pool resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_rule': {'readonly': True}, + 'outbound_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'load_balancer_backend_addresses': {'key': 'properties.loadBalancerBackendAddresses', 'type': '[LoadBalancerBackendAddress]'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_rule': {'key': 'properties.outboundRule', 'type': 'SubResource'}, + 'outbound_rules': {'key': 'properties.outboundRules', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackendAddressPool, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.load_balancer_backend_addresses = kwargs.get('load_balancer_backend_addresses', None) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_rule = None + self.outbound_rules = None + self.provisioning_state = None + + +class BastionActiveSession(msrest.serialization.Model): + """The session detail for a target. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar session_id: A unique id for the session. + :vartype session_id: str + :ivar start_time: The time when the session started. + :vartype start_time: object + :ivar target_subscription_id: The subscription id for the target virtual machine. + :vartype target_subscription_id: str + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar target_host_name: The host name of the target. + :vartype target_host_name: str + :ivar target_resource_group: The resource group of the target. + :vartype target_resource_group: str + :ivar user_name: The user name who is active on this session. + :vartype user_name: str + :ivar target_ip_address: The IP Address of the target. + :vartype target_ip_address: str + :ivar protocol: The protocol used to connect to the target. Possible values include: "SSH", + "RDP". + :vartype protocol: str or ~azure.mgmt.network.v2020_07_01.models.BastionConnectProtocol + :ivar target_resource_id: The resource id of the target. + :vartype target_resource_id: str + :ivar session_duration_in_mins: Duration in mins the session has been active. + :vartype session_duration_in_mins: float + """ + + _validation = { + 'session_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'target_subscription_id': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'target_host_name': {'readonly': True}, + 'target_resource_group': {'readonly': True}, + 'user_name': {'readonly': True}, + 'target_ip_address': {'readonly': True}, + 'protocol': {'readonly': True}, + 'target_resource_id': {'readonly': True}, + 'session_duration_in_mins': {'readonly': True}, + } + + _attribute_map = { + 'session_id': {'key': 'sessionId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'object'}, + 'target_subscription_id': {'key': 'targetSubscriptionId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'target_host_name': {'key': 'targetHostName', 'type': 'str'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'target_ip_address': {'key': 'targetIpAddress', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'session_duration_in_mins': {'key': 'sessionDurationInMins', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionActiveSession, self).__init__(**kwargs) + self.session_id = None + self.start_time = None + self.target_subscription_id = None + self.resource_type = None + self.target_host_name = None + self.target_resource_group = None + self.user_name = None + self.target_ip_address = None + self.protocol = None + self.target_resource_id = None + self.session_duration_in_mins = None + + +class BastionActiveSessionListResult(msrest.serialization.Model): + """Response for GetActiveSessions. + + :param value: List of active sessions on the bastion. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionActiveSession] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionActiveSession]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionActiveSessionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class BastionHost(Resource): + """Bastion Host resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param ip_configurations: IP configuration of the Bastion Host resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.BastionHostIPConfiguration] + :param dns_name: FQDN for the endpoint on which bastion host is accessible. + :type dns_name: str + :ivar provisioning_state: The provisioning state of the bastion host resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[BastionHostIPConfiguration]'}, + 'dns_name': {'key': 'properties.dnsName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionHost, self).__init__(**kwargs) + self.etag = None + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_name = kwargs.get('dns_name', None) + self.provisioning_state = None + + +class BastionHostIPConfiguration(SubResource): + """IP configuration of an Bastion Host. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Ip configuration type. + :vartype type: str + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the bastion host IP configuration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_ip_allocation_method: Private IP allocation method. Possible values include: + "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionHostIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = None + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + + +class BastionHostListResult(msrest.serialization.Model): + """Response for ListBastionHosts API service call. + + :param value: List of Bastion Hosts in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionHost] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionHost]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionHostListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class BastionSessionDeleteResult(msrest.serialization.Model): + """Response for DisconnectActiveSessions. + + :param value: List of sessions with their corresponding state. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionSessionState] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionSessionState]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionSessionDeleteResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class BastionSessionState(msrest.serialization.Model): + """The session state detail for a target. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar session_id: A unique id for the session. + :vartype session_id: str + :ivar message: Used for extra information. + :vartype message: str + :ivar state: The state of the session. Disconnected/Failed/NotFound. + :vartype state: str + """ + + _validation = { + 'session_id': {'readonly': True}, + 'message': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'session_id': {'key': 'sessionId', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionSessionState, self).__init__(**kwargs) + self.session_id = None + self.message = None + self.state = None + + +class BastionShareableLink(msrest.serialization.Model): + """Bastion Shareable Link. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm: Required. Reference of the virtual machine resource. + :type vm: ~azure.mgmt.network.v2020_07_01.models.Resource + :ivar bsl: The unique Bastion Shareable Link to the virtual machine. + :vartype bsl: str + :ivar created_at: The time when the link was created. + :vartype created_at: str + :ivar message: Optional field indicating the warning or error message related to the vm in case + of partial failure. + :vartype message: str + """ + + _validation = { + 'vm': {'required': True}, + 'bsl': {'readonly': True}, + 'created_at': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'vm': {'key': 'vm', 'type': 'Resource'}, + 'bsl': {'key': 'bsl', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionShareableLink, self).__init__(**kwargs) + self.vm = kwargs['vm'] + self.bsl = None + self.created_at = None + self.message = None + + +class BastionShareableLinkListRequest(msrest.serialization.Model): + """Post request for all the Bastion Shareable Link endpoints. + + :param vms: List of VM references. + :type vms: list[~azure.mgmt.network.v2020_07_01.models.BastionShareableLink] + """ + + _attribute_map = { + 'vms': {'key': 'vms', 'type': '[BastionShareableLink]'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionShareableLinkListRequest, self).__init__(**kwargs) + self.vms = kwargs.get('vms', None) + + +class BastionShareableLinkListResult(msrest.serialization.Model): + """Response for all the Bastion Shareable Link endpoints. + + :param value: List of Bastion Shareable Links for the request. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionShareableLink] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionShareableLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionShareableLinkListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class BGPCommunity(msrest.serialization.Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. e.g. For O365, region is + Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) + + +class BgpConnection(SubResource): + """Virtual Appliance Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the connection. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Connection type. + :vartype type: str + :param peer_asn: Peer ASN. + :type peer_asn: long + :param peer_ip: Peer IP. + :type peer_ip: str + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar connection_state: The current state of the VirtualHub to Peer. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_state: str or ~azure.mgmt.network.v2020_07_01.models.HubBgpConnectionStatus + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'connection_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peer_asn': {'key': 'properties.peerAsn', 'type': 'long'}, + 'peer_ip': {'key': 'properties.peerIp', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'connection_state': {'key': 'properties.connectionState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.peer_asn = kwargs.get('peer_asn', None) + self.peer_ip = kwargs.get('peer_ip', None) + self.provisioning_state = None + self.connection_state = None + + +class BgpPeerStatus(msrest.serialization.Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The virtual network gateway's local address. + :vartype local_address: str + :ivar neighbor: The remote BGP peer. + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer. + :vartype asn: long + :ivar state: The BGP peer state. Possible values include: "Unknown", "Stopped", "Idle", + "Connecting", "Connected". + :vartype state: str or ~azure.mgmt.network.v2020_07_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up. + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer. + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent. + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received. + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'long'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None + + +class BgpPeerStatusListResult(msrest.serialization.Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: A list of bgp communities. + :type bgp_communities: list[~azure.mgmt.network.v2020_07_01.models.BGPCommunity] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) + + +class BgpServiceCommunityListResult(msrest.serialization.Model): + """Response for the ListServiceCommunity API service call. + + :param value: A list of service community resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BgpServiceCommunity] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpServiceCommunity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpServiceCommunityListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class BgpSettings(msrest.serialization.Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP speaker. + :type peer_weight: int + :param bgp_peering_addresses: BGP peering address with IP configuration ID for virtual network + gateway. + :type bgp_peering_addresses: + list[~azure.mgmt.network.v2020_07_01.models.IPConfigurationBgpPeeringAddress] + """ + + _validation = { + 'asn': {'maximum': 4294967295, 'minimum': 0}, + } + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + 'bgp_peering_addresses': {'key': 'bgpPeeringAddresses', 'type': '[IPConfigurationBgpPeeringAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) + self.bgp_peering_addresses = kwargs.get('bgp_peering_addresses', None) + + +class BreakOutCategoryPolicies(msrest.serialization.Model): + """Network Virtual Appliance Sku Properties. + + :param allow: Flag to control breakout of o365 allow category. + :type allow: bool + :param optimize: Flag to control breakout of o365 optimize category. + :type optimize: bool + :param default: Flag to control breakout of o365 default category. + :type default: bool + """ + + _attribute_map = { + 'allow': {'key': 'allow', 'type': 'bool'}, + 'optimize': {'key': 'optimize', 'type': 'bool'}, + 'default': {'key': 'default', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BreakOutCategoryPolicies, self).__init__(**kwargs) + self.allow = kwargs.get('allow', None) + self.optimize = kwargs.get('optimize', None) + self.default = kwargs.get('default', None) + + +class CheckPrivateLinkServiceVisibilityRequest(msrest.serialization.Model): + """Request body of the CheckPrivateLinkServiceVisibility API service call. + + :param private_link_service_alias: The alias of the private link service. + :type private_link_service_alias: str + """ + + _attribute_map = { + 'private_link_service_alias': {'key': 'privateLinkServiceAlias', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckPrivateLinkServiceVisibilityRequest, self).__init__(**kwargs) + self.private_link_service_alias = kwargs.get('private_link_service_alias', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.network.v2020_07_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConnectionMonitor(msrest.serialization.Model): + """Parameters that define the operation to create a connection monitor. + + :param location: Connection monitor location. + :type location: str + :param tags: A set of tags. Connection monitor tags. + :type tags: dict[str, str] + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _validation = { + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'properties.endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'properties.testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'properties.testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'properties.outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) + self.endpoints = kwargs.get('endpoints', None) + self.test_configurations = kwargs.get('test_configurations', None) + self.test_groups = kwargs.get('test_groups', None) + self.outputs = kwargs.get('outputs', None) + self.notes = kwargs.get('notes', None) + + +class ConnectionMonitorDestination(msrest.serialization.Model): + """Describes the destination of connection monitor. + + :param resource_id: The ID of the resource used as the destination by connection monitor. + :type resource_id: str + :param address: Address of the connection monitor destination (IP or domain name). + :type address: str + :param port: The destination port used by connection monitor. + :type port: int + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) + + +class ConnectionMonitorEndpoint(msrest.serialization.Model): + """Describes the connection monitor endpoint. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the connection monitor endpoint. + :type name: str + :param type: The endpoint type. Possible values include: "AzureVM", "AzureVNet", "AzureSubnet", + "ExternalAddress", "MMAWorkspaceMachine", "MMAWorkspaceNetwork". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.EndpointType + :param resource_id: Resource ID of the connection monitor endpoint. + :type resource_id: str + :param address: Address of the connection monitor endpoint (IP or domain name). + :type address: str + :param filter: Filter for sub-items within the endpoint. + :type filter: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilter + :param scope: Endpoint scope. + :type scope: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointScope + :param coverage_level: Test coverage for the endpoint. Possible values include: "Default", + "Low", "BelowAverage", "Average", "AboveAverage", "Full". + :type coverage_level: str or ~azure.mgmt.network.v2020_07_01.models.CoverageLevel + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ConnectionMonitorEndpointFilter'}, + 'scope': {'key': 'scope', 'type': 'ConnectionMonitorEndpointScope'}, + 'coverage_level': {'key': 'coverageLevel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpoint, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs.get('type', None) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.filter = kwargs.get('filter', None) + self.scope = kwargs.get('scope', None) + self.coverage_level = kwargs.get('coverage_level', None) + + +class ConnectionMonitorEndpointFilter(msrest.serialization.Model): + """Describes the connection monitor endpoint filter. + + :param type: The behavior of the endpoint filter. Currently only 'Include' is supported. + Possible values include: "Include". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilterType + :param items: List of items in the filter. + :type items: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'items': {'key': 'items', 'type': '[ConnectionMonitorEndpointFilterItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointFilter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.items = kwargs.get('items', None) + + +class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): + """Describes the connection monitor endpoint filter item. + + :param type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. Possible values include: "AgentAddress". + :type type: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilterItemType + :param address: The address of the filter item. + :type address: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointFilterItem, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.address = kwargs.get('address', None) + + +class ConnectionMonitorEndpointScope(msrest.serialization.Model): + """Describes the connection monitor endpoint scope. + + :param include: List of items which needs to be included to the endpoint scope. + :type include: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointScopeItem] + :param exclude: List of items which needs to be excluded from the endpoint scope. + :type exclude: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointScopeItem] + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': '[ConnectionMonitorEndpointScopeItem]'}, + 'exclude': {'key': 'exclude', 'type': '[ConnectionMonitorEndpointScopeItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointScope, self).__init__(**kwargs) + self.include = kwargs.get('include', None) + self.exclude = kwargs.get('exclude', None) + + +class ConnectionMonitorEndpointScopeItem(msrest.serialization.Model): + """Describes the connection monitor endpoint scope item. + + :param address: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + IPv4/IPv6 IP address. + :type address: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointScopeItem, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + + +class ConnectionMonitorHttpConfiguration(msrest.serialization.Model): + """Describes the HTTP configuration. + + :param port: The port to connect to. + :type port: int + :param method: The HTTP method to use. Possible values include: "Get", "Post". + :type method: str or ~azure.mgmt.network.v2020_07_01.models.HTTPConfigurationMethod + :param path: The path component of the URI. For instance, "/dir1/dir2". + :type path: str + :param request_headers: The HTTP headers to transmit with the request. + :type request_headers: list[~azure.mgmt.network.v2020_07_01.models.HTTPHeader] + :param valid_status_code_ranges: HTTP status codes to consider successful. For instance, + "2xx,301-304,418". + :type valid_status_code_ranges: list[str] + :param prefer_https: Value indicating whether HTTPS is preferred over HTTP in cases where the + choice is not explicit. + :type prefer_https: bool + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'int'}, + 'method': {'key': 'method', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'request_headers': {'key': 'requestHeaders', 'type': '[HTTPHeader]'}, + 'valid_status_code_ranges': {'key': 'validStatusCodeRanges', 'type': '[str]'}, + 'prefer_https': {'key': 'preferHTTPS', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorHttpConfiguration, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.method = kwargs.get('method', None) + self.path = kwargs.get('path', None) + self.request_headers = kwargs.get('request_headers', None) + self.valid_status_code_ranges = kwargs.get('valid_status_code_ranges', None) + self.prefer_https = kwargs.get('prefer_https', None) + + +class ConnectionMonitorIcmpConfiguration(msrest.serialization.Model): + """Describes the ICMP configuration. + + :param disable_trace_route: Value indicating whether path evaluation with trace route should be + disabled. + :type disable_trace_route: bool + """ + + _attribute_map = { + 'disable_trace_route': {'key': 'disableTraceRoute', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorIcmpConfiguration, self).__init__(**kwargs) + self.disable_trace_route = kwargs.get('disable_trace_route', None) + + +class ConnectionMonitorListResult(msrest.serialization.Model): + """List of connection monitors. + + :param value: Information about connection monitors. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConnectionMonitorResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ConnectionMonitorOutput(msrest.serialization.Model): + """Describes a connection monitor output destination. + + :param type: Connection monitor output destination type. Currently, only "Workspace" is + supported. Possible values include: "Workspace". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.OutputType + :param workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :type workspace_settings: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorWorkspaceSettings + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_settings': {'key': 'workspaceSettings', 'type': 'ConnectionMonitorWorkspaceSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorOutput, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.workspace_settings = kwargs.get('workspace_settings', None) + + +class ConnectionMonitorParameters(msrest.serialization.Model): + """Parameters that define the operation to create a connection monitor. + + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _validation = { + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'notes', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) + self.endpoints = kwargs.get('endpoints', None) + self.test_configurations = kwargs.get('test_configurations', None) + self.test_groups = kwargs.get('test_groups', None) + self.outputs = kwargs.get('outputs', None) + self.notes = kwargs.get('notes', None) + + +class ConnectionMonitorQueryResult(msrest.serialization.Model): + """List of connection states snapshots. + + :param source_status: Status of connection monitor source. Possible values include: "Unknown", + "Active", "Inactive". + :type source_status: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSourceStatus + :param states: Information about connection states. + :type states: list[~azure.mgmt.network.v2020_07_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + 'source_status': {'key': 'sourceStatus', 'type': 'str'}, + 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.source_status = kwargs.get('source_status', None) + self.states = kwargs.get('states', None) + + +class ConnectionMonitorResult(msrest.serialization.Model): + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Connection monitor type. + :vartype type: str + :param location: Connection monitor location. + :type location: str + :param tags: A set of tags. Connection monitor tags. + :type tags: dict[str, str] + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + :ivar provisioning_state: The provisioning state of the connection monitor. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar start_time: The date and time when the connection monitor was started. + :vartype start_time: ~datetime.datetime + :ivar monitoring_status: The monitoring status of the connection monitor. + :vartype monitoring_status: str + :ivar connection_monitor_type: Type of connection monitor. Possible values include: + "MultiEndpoint", "SingleSourceDestination". + :vartype connection_monitor_type: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorType + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'monitoring_status': {'readonly': True}, + 'connection_monitor_type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'properties.endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'properties.testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'properties.testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'properties.outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'connection_monitor_type': {'key': 'properties.connectionMonitorType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) + self.endpoints = kwargs.get('endpoints', None) + self.test_configurations = kwargs.get('test_configurations', None) + self.test_groups = kwargs.get('test_groups', None) + self.outputs = kwargs.get('outputs', None) + self.notes = kwargs.get('notes', None) + self.provisioning_state = None + self.start_time = None + self.monitoring_status = None + self.connection_monitor_type = None + + +class ConnectionMonitorResultProperties(ConnectionMonitorParameters): + """Describes the properties of a connection monitor. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + :ivar provisioning_state: The provisioning state of the connection monitor. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar start_time: The date and time when the connection monitor was started. + :vartype start_time: ~datetime.datetime + :ivar monitoring_status: The monitoring status of the connection monitor. + :vartype monitoring_status: str + :ivar connection_monitor_type: Type of connection monitor. Possible values include: + "MultiEndpoint", "SingleSourceDestination". + :vartype connection_monitor_type: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorType + """ + + _validation = { + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'monitoring_status': {'readonly': True}, + 'connection_monitor_type': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'notes', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + 'connection_monitor_type': {'key': 'connectionMonitorType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorResultProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.start_time = None + self.monitoring_status = None + self.connection_monitor_type = None + + +class ConnectionMonitorSource(msrest.serialization.Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by connection monitor. + :type resource_id: str + :param port: The source port used by connection monitor. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.port = kwargs.get('port', None) + + +class ConnectionMonitorSuccessThreshold(msrest.serialization.Model): + """Describes the threshold for declaring a test successful. + + :param checks_failed_percent: The maximum percentage of failed checks permitted for a test to + evaluate as successful. + :type checks_failed_percent: int + :param round_trip_time_ms: The maximum round-trip time in milliseconds permitted for a test to + evaluate as successful. + :type round_trip_time_ms: float + """ + + _attribute_map = { + 'checks_failed_percent': {'key': 'checksFailedPercent', 'type': 'int'}, + 'round_trip_time_ms': {'key': 'roundTripTimeMs', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorSuccessThreshold, self).__init__(**kwargs) + self.checks_failed_percent = kwargs.get('checks_failed_percent', None) + self.round_trip_time_ms = kwargs.get('round_trip_time_ms', None) + + +class ConnectionMonitorTcpConfiguration(msrest.serialization.Model): + """Describes the TCP configuration. + + :param port: The port to connect to. + :type port: int + :param disable_trace_route: Value indicating whether path evaluation with trace route should be + disabled. + :type disable_trace_route: bool + :param destination_port_behavior: Destination port behavior. Possible values include: "None", + "ListenIfAvailable". + :type destination_port_behavior: str or + ~azure.mgmt.network.v2020_07_01.models.DestinationPortBehavior + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'int'}, + 'disable_trace_route': {'key': 'disableTraceRoute', 'type': 'bool'}, + 'destination_port_behavior': {'key': 'destinationPortBehavior', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorTcpConfiguration, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.disable_trace_route = kwargs.get('disable_trace_route', None) + self.destination_port_behavior = kwargs.get('destination_port_behavior', None) + + +class ConnectionMonitorTestConfiguration(msrest.serialization.Model): + """Describes a connection monitor test configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the connection monitor test configuration. + :type name: str + :param test_frequency_sec: The frequency of test evaluation, in seconds. + :type test_frequency_sec: int + :param protocol: Required. The protocol to use in test evaluation. Possible values include: + "Tcp", "Http", "Icmp". + :type protocol: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfigurationProtocol + :param preferred_ip_version: The preferred IP version to use in test evaluation. The connection + monitor may choose to use a different version depending on other parameters. Possible values + include: "IPv4", "IPv6". + :type preferred_ip_version: str or ~azure.mgmt.network.v2020_07_01.models.PreferredIPVersion + :param http_configuration: The parameters used to perform test evaluation over HTTP. + :type http_configuration: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorHttpConfiguration + :param tcp_configuration: The parameters used to perform test evaluation over TCP. + :type tcp_configuration: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTcpConfiguration + :param icmp_configuration: The parameters used to perform test evaluation over ICMP. + :type icmp_configuration: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorIcmpConfiguration + :param success_threshold: The threshold for declaring a test successful. + :type success_threshold: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSuccessThreshold + """ + + _validation = { + 'name': {'required': True}, + 'protocol': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'test_frequency_sec': {'key': 'testFrequencySec', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'preferred_ip_version': {'key': 'preferredIPVersion', 'type': 'str'}, + 'http_configuration': {'key': 'httpConfiguration', 'type': 'ConnectionMonitorHttpConfiguration'}, + 'tcp_configuration': {'key': 'tcpConfiguration', 'type': 'ConnectionMonitorTcpConfiguration'}, + 'icmp_configuration': {'key': 'icmpConfiguration', 'type': 'ConnectionMonitorIcmpConfiguration'}, + 'success_threshold': {'key': 'successThreshold', 'type': 'ConnectionMonitorSuccessThreshold'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorTestConfiguration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.test_frequency_sec = kwargs.get('test_frequency_sec', None) + self.protocol = kwargs['protocol'] + self.preferred_ip_version = kwargs.get('preferred_ip_version', None) + self.http_configuration = kwargs.get('http_configuration', None) + self.tcp_configuration = kwargs.get('tcp_configuration', None) + self.icmp_configuration = kwargs.get('icmp_configuration', None) + self.success_threshold = kwargs.get('success_threshold', None) + + +class ConnectionMonitorTestGroup(msrest.serialization.Model): + """Describes the connection monitor test group. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the connection monitor test group. + :type name: str + :param disable: Value indicating whether test group is disabled. + :type disable: bool + :param test_configurations: Required. List of test configuration names. + :type test_configurations: list[str] + :param sources: Required. List of source endpoint names. + :type sources: list[str] + :param destinations: Required. List of destination endpoint names. + :type destinations: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'test_configurations': {'required': True}, + 'sources': {'required': True}, + 'destinations': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disable': {'key': 'disable', 'type': 'bool'}, + 'test_configurations': {'key': 'testConfigurations', 'type': '[str]'}, + 'sources': {'key': 'sources', 'type': '[str]'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorTestGroup, self).__init__(**kwargs) + self.name = kwargs['name'] + self.disable = kwargs.get('disable', None) + self.test_configurations = kwargs['test_configurations'] + self.sources = kwargs['sources'] + self.destinations = kwargs['destinations'] + + +class ConnectionMonitorWorkspaceSettings(msrest.serialization.Model): + """Describes the settings for producing output into a log analytics workspace. + + :param workspace_resource_id: Log analytics workspace resource ID. + :type workspace_resource_id: str + """ + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorWorkspaceSettings, self).__init__(**kwargs) + self.workspace_resource_id = kwargs.get('workspace_resource_id', None) + + +class ConnectionResetSharedKey(msrest.serialization.Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared key length, should + between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs['key_length'] + + +class ConnectionSharedKey(SubResource): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs['value'] + + +class ConnectionStateSnapshot(msrest.serialization.Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param connection_state: The connection state. Possible values include: "Reachable", + "Unreachable", "Unknown". + :type connection_state: str or ~azure.mgmt.network.v2020_07_01.models.ConnectionState + :param start_time: The start time of the connection snapshot. + :type start_time: ~datetime.datetime + :param end_time: The end time of the connection snapshot. + :type end_time: ~datetime.datetime + :param evaluation_state: Connectivity analysis evaluation state. Possible values include: + "NotStarted", "InProgress", "Completed". + :type evaluation_state: str or ~azure.mgmt.network.v2020_07_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: long + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: long + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: long + :param probes_sent: The number of sent probes. + :type probes_sent: long + :param probes_failed: The number of failed probes. + :type probes_failed: long + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityHop] + """ + + _validation = { + 'avg_latency_in_ms': {'maximum': 4294967295, 'minimum': 0}, + 'min_latency_in_ms': {'maximum': 4294967295, 'minimum': 0}, + 'max_latency_in_ms': {'maximum': 4294967295, 'minimum': 0}, + 'probes_sent': {'maximum': 4294967295, 'minimum': 0}, + 'probes_failed': {'maximum': 4294967295, 'minimum': 0}, + 'hops': {'readonly': True}, + } + + _attribute_map = { + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'long'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'long'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'long'}, + 'probes_sent': {'key': 'probesSent', 'type': 'long'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'long'}, + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = kwargs.get('connection_state', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.evaluation_state = kwargs.get('evaluation_state', None) + self.avg_latency_in_ms = kwargs.get('avg_latency_in_ms', None) + self.min_latency_in_ms = kwargs.get('min_latency_in_ms', None) + self.max_latency_in_ms = kwargs.get('max_latency_in_ms', None) + self.probes_sent = kwargs.get('probes_sent', None) + self.probes_failed = kwargs.get('probes_failed', None) + self.hops = None + + +class ConnectivityDestination(msrest.serialization.Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) + + +class ConnectivityHop(msrest.serialization.Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar previous_hop_ids: List of previous hop identifiers. + :vartype previous_hop_ids: list[str] + :ivar links: List of hop links. + :vartype links: list[~azure.mgmt.network.v2020_07_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2020_07_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'previous_hop_ids': {'readonly': True}, + 'links': {'readonly': True}, + 'previous_links': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'previous_hop_ids': {'key': 'previousHopIds', 'type': '[str]'}, + 'links': {'key': 'links', 'type': '[HopLink]'}, + 'previous_links': {'key': 'previousLinks', 'type': '[HopLink]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.previous_hop_ids = None + self.links = None + self.previous_links = None + self.issues = None + + +class ConnectivityInformation(msrest.serialization.Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: "Unknown", + "Connected", "Disconnected", "Degraded". + :vartype connection_status: str or ~azure.mgmt.network.v2020_07_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None + + +class ConnectivityIssue(msrest.serialization.Model): + """Information about an issue encountered in the process of checking for connectivity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the issue. Possible values include: "Local", "Inbound", "Outbound". + :vartype origin: str or ~azure.mgmt.network.v2020_07_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". + :vartype severity: str or ~azure.mgmt.network.v2020_07_01.models.Severity + :ivar type: The type of issue. Possible values include: "Unknown", "AgentStopped", + "GuestFirewall", "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", + "PortThrottled", "Platform". + :vartype type: str or ~azure.mgmt.network.v2020_07_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None + + +class ConnectivityParameters(msrest.serialization.Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the connection. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectivitySource + :param destination: Required. The destination of connection. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectivityDestination + :param protocol: Network protocol. Possible values include: "Tcp", "Http", "Https", "Icmp". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.Protocol + :param protocol_configuration: Configuration of the protocol. + :type protocol_configuration: ~azure.mgmt.network.v2020_07_01.models.ProtocolConfiguration + :param preferred_ip_version: Preferred IP version of the connection. Possible values include: + "IPv4", "IPv6". + :type preferred_ip_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'protocol_configuration': {'key': 'protocolConfiguration', 'type': 'ProtocolConfiguration'}, + 'preferred_ip_version': {'key': 'preferredIPVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs['source'] + self.destination = kwargs['destination'] + self.protocol = kwargs.get('protocol', None) + self.protocol_configuration = kwargs.get('protocol_configuration', None) + self.preferred_ip_version = kwargs.get('preferred_ip_version', None) + + +class ConnectivitySource(msrest.serialization.Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a connectivity check will be + initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs['resource_id'] + self.port = kwargs.get('port', None) + + +class Container(SubResource): + """Reference to container resource in remote resource provider. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Container, self).__init__(**kwargs) + + +class ContainerNetworkInterface(SubResource): + """Container network interface child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar container_network_interface_configuration: Container network interface configuration from + which this container network interface is created. + :vartype container_network_interface_configuration: + ~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterfaceConfiguration + :param container: Reference to the container to which this container network interface is + attached. + :type container: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterfaceIpConfiguration] + :ivar provisioning_state: The provisioning state of the container network interface resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'container_network_interface_configuration': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'container_network_interface_configuration': {'key': 'properties.containerNetworkInterfaceConfiguration', 'type': 'ContainerNetworkInterfaceConfiguration'}, + 'container': {'key': 'properties.container', 'type': 'SubResource'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[ContainerNetworkInterfaceIpConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerNetworkInterface, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.etag = None + self.container_network_interface_configuration = None + self.container = kwargs.get('container', None) + self.ip_configurations = None + self.provisioning_state = None + + +class ContainerNetworkInterfaceConfiguration(SubResource): + """Container network interface configuration child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param ip_configurations: A list of ip configurations of the container network interface + configuration. + :type ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.IPConfigurationProfile] + :param container_network_interfaces: A list of container network interfaces created from this + container network interface configuration. + :type container_network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the container network interface + configuration resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfigurationProfile]'}, + 'container_network_interfaces': {'key': 'properties.containerNetworkInterfaces', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerNetworkInterfaceConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.etag = None + self.ip_configurations = kwargs.get('ip_configurations', None) + self.container_network_interfaces = kwargs.get('container_network_interfaces', None) + self.provisioning_state = None + + +class ContainerNetworkInterfaceIpConfiguration(msrest.serialization.Model): + """The ip configuration for a container network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the container network interface IP + configuration resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerNetworkInterfaceIpConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.etag = None + self.provisioning_state = None + + +class CustomDnsConfigPropertiesFormat(msrest.serialization.Model): + """Contains custom Dns resolution configuration from customer. + + :param fqdn: Fqdn that resolves to private endpoint ip address. + :type fqdn: str + :param ip_addresses: A list of private ip addresses of the private endpoint. + :type ip_addresses: list[str] + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomDnsConfigPropertiesFormat, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_addresses = kwargs.get('ip_addresses', None) + + +class CustomIpPrefix(Resource): + """Custom IP prefix resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :param cidr: The prefix range in CIDR notation. Should include the start address and the prefix + length. + :type cidr: str + :param commissioned_state: The commissioned state of the Custom IP Prefix. Possible values + include: "Provisioning", "Provisioned", "Commissioning", "Commissioned", "Decommissioning", + "Deprovisioning". + :type commissioned_state: str or ~azure.mgmt.network.v2020_07_01.models.CommissionedState + :ivar public_ip_prefixes: The list of all referenced PublicIpPrefixes. + :vartype public_ip_prefixes: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar resource_guid: The resource GUID property of the custom IP prefix resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the custom IP prefix resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'public_ip_prefixes': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'cidr': {'key': 'properties.cidr', 'type': 'str'}, + 'commissioned_state': {'key': 'properties.commissionedState', 'type': 'str'}, + 'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomIpPrefix, self).__init__(**kwargs) + self.etag = None + self.zones = kwargs.get('zones', None) + self.cidr = kwargs.get('cidr', None) + self.commissioned_state = kwargs.get('commissioned_state', None) + self.public_ip_prefixes = None + self.resource_guid = None + self.provisioning_state = None + + +class CustomIpPrefixListResult(msrest.serialization.Model): + """Response for ListCustomIpPrefixes API service call. + + :param value: A list of Custom IP prefixes that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CustomIpPrefix]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomIpPrefixListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class DdosCustomPolicy(Resource): + """A DDoS custom policy in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the DDoS custom policy resource. It uniquely + identifies the resource, even if the user changes its name or migrate the resource across + subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DDoS custom policy resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar public_ip_addresses: The list of public IPs associated with the DDoS custom policy + resource. This list is read-only. + :vartype public_ip_addresses: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param protocol_custom_settings: The protocol-specific DDoS policy customization parameters. + :type protocol_custom_settings: + list[~azure.mgmt.network.v2020_07_01.models.ProtocolCustomSettingsFormat] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[SubResource]'}, + 'protocol_custom_settings': {'key': 'properties.protocolCustomSettings', 'type': '[ProtocolCustomSettingsFormat]'}, + } + + def __init__( + self, + **kwargs + ): + super(DdosCustomPolicy, self).__init__(**kwargs) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + self.public_ip_addresses = None + self.protocol_custom_settings = kwargs.get('protocol_custom_settings', None) + + +class DdosProtectionPlan(msrest.serialization.Model): + """A DDoS protection plan in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the DDoS protection plan resource. It + uniquely identifies the resource, even if the user changes its name or migrate the resource + across subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DDoS protection plan resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar virtual_networks: The list of virtual networks associated with the DDoS protection plan + resource. This list is read-only. + :vartype virtual_networks: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'virtual_networks': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(DdosProtectionPlan, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + self.virtual_networks = None + + +class DdosProtectionPlanListResult(msrest.serialization.Model): + """A list of DDoS protection plans. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of DDoS protection plans. + :type value: list[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DdosProtectionPlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DdosProtectionPlanListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class DdosSettings(msrest.serialization.Model): + """Contains the DDoS protection settings of the public IP. + + :param ddos_custom_policy: The DDoS custom policy associated with the public IP. + :type ddos_custom_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protection_coverage: The DDoS protection policy customizability of the public IP. Only + standard coverage will have the ability to be customized. Possible values include: "Basic", + "Standard". + :type protection_coverage: str or + ~azure.mgmt.network.v2020_07_01.models.DdosSettingsProtectionCoverage + :param protected_ip: Enables DDoS protection on the public IP. + :type protected_ip: bool + """ + + _attribute_map = { + 'ddos_custom_policy': {'key': 'ddosCustomPolicy', 'type': 'SubResource'}, + 'protection_coverage': {'key': 'protectionCoverage', 'type': 'str'}, + 'protected_ip': {'key': 'protectedIP', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DdosSettings, self).__init__(**kwargs) + self.ddos_custom_policy = kwargs.get('ddos_custom_policy', None) + self.protection_coverage = kwargs.get('protection_coverage', None) + self.protected_ip = kwargs.get('protected_ip', None) + + +class Delegation(SubResource): + """Details the service to which the subnet is delegated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a subnet. This name can be used to + access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param service_name: The name of the service to whom the subnet should be delegated (e.g. + Microsoft.Sql/servers). + :type service_name: str + :ivar actions: The actions permitted to the service upon delegation. + :vartype actions: list[str] + :ivar provisioning_state: The provisioning state of the service delegation resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'actions': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Delegation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.service_name = kwargs.get('service_name', None) + self.actions = None + self.provisioning_state = None + + +class DeviceProperties(msrest.serialization.Model): + """List of properties of the device. + + :param device_vendor: Name of the device Vendor. + :type device_vendor: str + :param device_model: Model of the device. + :type device_model: str + :param link_speed_in_mbps: Link speed. + :type link_speed_in_mbps: int + """ + + _attribute_map = { + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_model': {'key': 'deviceModel', 'type': 'str'}, + 'link_speed_in_mbps': {'key': 'linkSpeedInMbps', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DeviceProperties, self).__init__(**kwargs) + self.device_vendor = kwargs.get('device_vendor', None) + self.device_model = kwargs.get('device_model', None) + self.link_speed_in_mbps = kwargs.get('link_speed_in_mbps', None) + + +class DhcpOptions(msrest.serialization.Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + + +class DnsNameAvailabilityResult(msrest.serialization.Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + + +class DnsSettings(msrest.serialization.Model): + """DNS Proxy Settings in Firewall Policy. + + :param servers: List of Custom DNS Servers. + :type servers: list[str] + :param enable_proxy: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + :type enable_proxy: bool + :param require_proxy_for_network_rules: FQDNs in Network Rules are supported when set to true. + :type require_proxy_for_network_rules: bool + """ + + _attribute_map = { + 'servers': {'key': 'servers', 'type': '[str]'}, + 'enable_proxy': {'key': 'enableProxy', 'type': 'bool'}, + 'require_proxy_for_network_rules': {'key': 'requireProxyForNetworkRules', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DnsSettings, self).__init__(**kwargs) + self.servers = kwargs.get('servers', None) + self.enable_proxy = kwargs.get('enable_proxy', None) + self.require_proxy_for_network_rules = kwargs.get('require_proxy_for_network_rules', None) + + +class DscpConfiguration(Resource): + """DSCP Configuration in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param markings: List of markings to be used in the configuration. + :type markings: list[int] + :param source_ip_ranges: Source IP ranges. + :type source_ip_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosIpRange] + :param destination_ip_ranges: Destination IP ranges. + :type destination_ip_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosIpRange] + :param source_port_ranges: Sources port ranges. + :type source_port_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosPortRange] + :param destination_port_ranges: Destination port ranges. + :type destination_port_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosPortRange] + :param protocol: RNM supported protocol types. Possible values include: "DoNotUse", "Icmp", + "Tcp", "Udp", "Gre", "Esp", "Ah", "Vxlan", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ProtocolType + :ivar qos_collection_id: Qos Collection ID generated by RNM. + :vartype qos_collection_id: str + :ivar associated_network_interfaces: Associated Network Interfaces to the DSCP Configuration. + :vartype associated_network_interfaces: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar resource_guid: The resource GUID property of the DSCP Configuration resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DSCP Configuration resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'qos_collection_id': {'readonly': True}, + 'associated_network_interfaces': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'markings': {'key': 'properties.markings', 'type': '[int]'}, + 'source_ip_ranges': {'key': 'properties.sourceIpRanges', 'type': '[QosIpRange]'}, + 'destination_ip_ranges': {'key': 'properties.destinationIpRanges', 'type': '[QosIpRange]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[QosPortRange]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[QosPortRange]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'qos_collection_id': {'key': 'properties.qosCollectionId', 'type': 'str'}, + 'associated_network_interfaces': {'key': 'properties.associatedNetworkInterfaces', 'type': '[NetworkInterface]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscpConfiguration, self).__init__(**kwargs) + self.etag = None + self.markings = kwargs.get('markings', None) + self.source_ip_ranges = kwargs.get('source_ip_ranges', None) + self.destination_ip_ranges = kwargs.get('destination_ip_ranges', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.protocol = kwargs.get('protocol', None) + self.qos_collection_id = None + self.associated_network_interfaces = None + self.resource_guid = None + self.provisioning_state = None + + +class DscpConfigurationListResult(msrest.serialization.Model): + """Response for the DscpConfigurationList API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of dscp configurations in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.DscpConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscpConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscpConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class EffectiveNetworkSecurityGroup(msrest.serialization.Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is applied. + :type network_security_group: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within the tag. + :type tag_map: str + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) + + +class EffectiveNetworkSecurityGroupAssociation(msrest.serialization.Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) + + +class EffectiveNetworkSecurityGroupListResult(msrest.serialization.Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of effective network security groups. + :type value: list[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class EffectiveNetworkSecurityRule(msrest.serialization.Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible values include: "Tcp", + "Udp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include a single integer + between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected values include a single + integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected values include CIDR IP + ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the + asterisk (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. Expected values include + CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and + the asterisk (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible values include: "Allow", + "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values include: "Inbound", "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + + +class EffectiveRoute(msrest.serialization.Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param disable_bgp_route_propagation: If true, on-premises routes are not propagated to the + network interfaces in the subnet. + :type disable_bgp_route_propagation: bool + :param source: Who created the route. Possible values include: "Unknown", "User", + "VirtualNetworkGateway", "Default". + :type source: str or ~azure.mgmt.network.v2020_07_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values include: "Active", "Invalid". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values + include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". + :type next_hop_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disable_bgp_route_propagation': {'key': 'disableBgpRoutePropagation', 'type': 'bool'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.disable_bgp_route_propagation = kwargs.get('disable_bgp_route_propagation', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + + +class EffectiveRouteListResult(msrest.serialization.Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2020_07_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class EffectiveRoutesParameters(msrest.serialization.Model): + """The parameters specifying the resource whose effective routes are being requested. + + :param resource_id: The resource whose effective routes are being requested. + :type resource_id: str + :param virtual_wan_resource_type: The type of the specified resource like RouteTable, + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :type virtual_wan_resource_type: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'virtual_wan_resource_type': {'key': 'virtualWanResourceType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EffectiveRoutesParameters, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.virtual_wan_resource_type = kwargs.get('virtual_wan_resource_type', None) + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointServiceResult, self).__init__(**kwargs) + self.name = None + self.type = None + + +class EndpointServicesListResult(msrest.serialization.Model): + """Response for the ListAvailableEndpointServices API service call. + + :param value: List of available endpoint services in a region. + :type value: list[~azure.mgmt.network.v2020_07_01.models.EndpointServiceResult] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EndpointServiceResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointServicesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Error(msrest.serialization.Model): + """Common error representation. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :param target: Error target. + :type target: str + :param details: Error details. + :type details: list[~azure.mgmt.network.v2020_07_01.models.ErrorDetails] + :param inner_error: Inner error message. + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) + + +class ErrorDetails(msrest.serialization.Model): + """Common error details representation. + + :param code: Error code. + :type code: str + :param target: Error target. + :type target: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class ErrorResponse(msrest.serialization.Model): + """The error object. + + :param error: The error details object. + :type error: ~azure.mgmt.network.v2020_07_01.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class EvaluatedNetworkSecurityGroup(msrest.serialization.Model): + """Results of network security group evaluation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param network_security_group_id: Network security group ID. + :type network_security_group_id: str + :param applied_to: Resource ID of nic or subnet to which network security group is applied. + :type applied_to: str + :param matched_rule: Matched network security rule. + :type matched_rule: ~azure.mgmt.network.v2020_07_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityRulesEvaluationResult] + """ + + _validation = { + 'rules_evaluation_result': {'readonly': True}, + } + + _attribute_map = { + 'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'}, + 'applied_to': {'key': 'appliedTo', 'type': 'str'}, + 'matched_rule': {'key': 'matchedRule', 'type': 'MatchedRule'}, + 'rules_evaluation_result': {'key': 'rulesEvaluationResult', 'type': '[NetworkSecurityRulesEvaluationResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group_id = kwargs.get('network_security_group_id', None) + self.applied_to = kwargs.get('applied_to', None) + self.matched_rule = kwargs.get('matched_rule', None) + self.rules_evaluation_result = None + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param allow_classic_operations: Allow classic operations. + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The ServiceProviderProvisioningState state of the + resource. Possible values include: "NotProvisioned", "Provisioning", "Provisioned", + "Deprovisioning". + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2020_07_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitServiceProviderProperties + :param express_route_port: The reference to the ExpressRoutePort resource when the circuit is + provisioned on an ExpressRoutePort resource. + :type express_route_port: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param bandwidth_in_gbps: The bandwidth of the circuit when the circuit is provisioned on an + ExpressRoutePort resource. + :type bandwidth_in_gbps: float + :ivar stag: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + :vartype stag: int + :ivar provisioning_state: The provisioning state of the express route circuit resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param global_reach_enabled: Flag denoting global reach status. + :type global_reach_enabled: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'stag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'express_route_port': {'key': 'properties.expressRoutePort', 'type': 'SubResource'}, + 'bandwidth_in_gbps': {'key': 'properties.bandwidthInGbps', 'type': 'float'}, + 'stag': {'key': 'properties.stag', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'global_reach_enabled': {'key': 'properties.globalReachEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.etag = None + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.express_route_port = kwargs.get('express_route_port', None) + self.bandwidth_in_gbps = kwargs.get('bandwidth_in_gbps', None) + self.stag = None + self.provisioning_state = None + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.global_reach_enabled = kwargs.get('global_reach_enabled', None) + + +class ExpressRouteCircuitArpTable(msrest.serialization.Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Entry age in minutes. + :type age: int + :param interface: Interface address. + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: The authorization use status. Possible values include: + "Available", "InUse". + :type authorization_use_status: str or + ~azure.mgmt.network.v2020_07_01.models.AuthorizationUseStatus + :ivar provisioning_state: The provisioning state of the authorization resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = None + + +class ExpressRouteCircuitConnection(SubResource): + """Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit initiating connection. + :type express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :type peer_express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :type address_prefix: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param ipv6_circuit_connection_config: IPv6 Address PrefixProperties of the express route + circuit connection. + :type ipv6_circuit_connection_config: + ~azure.mgmt.network.v2020_07_01.models.Ipv6CircuitConnectionConfig + :ivar circuit_connection_status: Express Route Circuit connection state. Possible values + include: "Connected", "Connecting", "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.CircuitConnectionStatus + :ivar provisioning_state: The provisioning state of the express route circuit connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'express_route_circuit_peering': {'key': 'properties.expressRouteCircuitPeering', 'type': 'SubResource'}, + 'peer_express_route_circuit_peering': {'key': 'properties.peerExpressRouteCircuitPeering', 'type': 'SubResource'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'ipv6_circuit_connection_config': {'key': 'properties.ipv6CircuitConnectionConfig', 'type': 'Ipv6CircuitConnectionConfig'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.express_route_circuit_peering = kwargs.get('express_route_circuit_peering', None) + self.peer_express_route_circuit_peering = kwargs.get('peer_express_route_circuit_peering', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.authorization_key = kwargs.get('authorization_key', None) + self.ipv6_circuit_connection_config = kwargs.get('ipv6_circuit_connection_config', None) + self.circuit_connection_status = None + self.provisioning_state = None + + +class ExpressRouteCircuitConnectionListResult(msrest.serialization.Model): + """Response for ListConnections API service call retrieves all global reach connections that belongs to a Private Peering for an ExpressRouteCircuit. + + :param value: The global reach connection associated with Private Peering in an ExpressRoute + Circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteCircuitListResult(msrest.serialization.Model): + """Response for ListExpressRouteCircuit API service call. + + :param value: A list of ExpressRouteCircuits in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuit]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param peering_type: The peering type. Possible values include: "AzurePublicPeering", + "AzurePrivatePeering", "MicrosoftPeering". + :type peering_type: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringConfig + :param stats: The peering stats of express route circuit. + :type stats: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitStats + :ivar provisioning_state: The provisioning state of the express route circuit peering resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar last_modified_by: Who was the last to modify the peering. + :vartype last_modified_by: str + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_07_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param express_route_connection: The ExpressRoute connection. + :type express_route_connection: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnectionId + :param connections: The list of circuit connections associated with Azure Private Peering for + this circuit. + :type connections: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection] + :ivar peered_connections: The list of peered circuit connections associated with Azure Private + Peering for this circuit. + :vartype peered_connections: + list[~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnection] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'peered_connections': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'SubResource'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'express_route_connection': {'key': 'properties.expressRouteConnection', 'type': 'ExpressRouteConnectionId'}, + 'connections': {'key': 'properties.connections', 'type': '[ExpressRouteCircuitConnection]'}, + 'peered_connections': {'key': 'properties.peeredConnections', 'type': '[PeerExpressRouteCircuitConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = None + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = None + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.express_route_connection = kwargs.get('express_route_connection', None) + self.connections = kwargs.get('connections', None) + self.peered_connections = None + + +class ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): + """Specifies the peering configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param advertised_public_prefixes: The reference to AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Specified for microsoft peering. + :type advertised_communities: list[str] + :ivar advertised_public_prefixes_state: The advertised public prefix state of the Peering + resource. Possible values include: "NotConfigured", "Configuring", "Configured", + "ValidationNeeded". + :vartype advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the configuration. + :type routing_registry_name: str + """ + + _validation = { + 'advertised_public_prefixes_state': {'readonly': True}, + } + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = None + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) + + +class ExpressRouteCircuitPeeringId(msrest.serialization.Model): + """ExpressRoute circuit peering identifier. + + :param id: The ID of the ExpressRoute circuit peering. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitPeeringId, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ExpressRouteCircuitPeeringListResult(msrest.serialization.Model): + """Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. + + :param value: The peerings in an express route circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitPeeringListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteCircuitReference(msrest.serialization.Model): + """Reference to an express route circuit. + + :param id: Corresponding Express Route Circuit Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ExpressRouteCircuitRoutesTable(msrest.serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: IP address of a network entity. + :type network: str + :param next_hop: NextHop address. + :type next_hop: str + :param loc_prf: Local preference value as set with the set local-preference route-map + configuration command. + :type loc_prf: str + :param weight: Route Weight. + :type weight: int + :param path: Autonomous system paths to the destination network. + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) + + +class ExpressRouteCircuitRoutesTableSummary(msrest.serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: IP address of the neighbor. + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of prefixes that have + been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) + + +class ExpressRouteCircuitsArpTableListResult(msrest.serialization.Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: A list of the ARP tables. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteCircuitServiceProviderProperties(msrest.serialization.Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) + + +class ExpressRouteCircuitSku(msrest.serialization.Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values include: "Standard", "Premium", "Basic", + "Local". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values include: "UnlimitedData", "MeteredData". + :type family: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) + + +class ExpressRouteCircuitsRoutesTableListResult(msrest.serialization.Model): + """Response for ListRoutesTable associated with the Express Route Circuits API. + + :param value: The list of routes table. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(msrest.serialization.Model): + """Response for ListRoutesTable associated with the Express Route Circuits API. + + :param value: A list of the routes table. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteCircuitStats(msrest.serialization.Model): + """Contains stats associated with the peering. + + :param primarybytes_in: The Primary BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: The primary BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: The secondary BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: The secondary BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) + + +class ExpressRouteConnection(SubResource): + """ExpressRouteConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param name: Required. The name of the resource. + :type name: str + :ivar provisioning_state: The provisioning state of the express route connection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param express_route_circuit_peering: The ExpressRoute circuit peering. + :type express_route_circuit_peering: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringId + :param authorization_key: Authorization key to establish the connection. + :type authorization_key: str + :param routing_weight: The routing weight associated to the connection. + :type routing_weight: int + :param enable_internet_security: Enable internet security. + :type enable_internet_security: bool + :param express_route_gateway_bypass: Enable FastPath to vWan Firewall hub. + :type express_route_gateway_bypass: bool + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + """ + + _validation = { + 'name': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_circuit_peering': {'key': 'properties.expressRouteCircuitPeering', 'type': 'ExpressRouteCircuitPeeringId'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'express_route_gateway_bypass': {'key': 'properties.expressRouteGatewayBypass', 'type': 'bool'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteConnection, self).__init__(**kwargs) + self.name = kwargs['name'] + self.provisioning_state = None + self.express_route_circuit_peering = kwargs.get('express_route_circuit_peering', None) + self.authorization_key = kwargs.get('authorization_key', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.enable_internet_security = kwargs.get('enable_internet_security', None) + self.express_route_gateway_bypass = kwargs.get('express_route_gateway_bypass', None) + self.routing_configuration = kwargs.get('routing_configuration', None) + + +class ExpressRouteConnectionId(msrest.serialization.Model): + """The ID of the ExpressRouteConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the ExpressRouteConnection. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteConnectionId, self).__init__(**kwargs) + self.id = None + + +class ExpressRouteConnectionList(msrest.serialization.Model): + """ExpressRouteConnection list. + + :param value: The list of ExpressRoute connections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteConnectionList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ExpressRouteCrossConnection(Resource): + """ExpressRouteCrossConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar primary_azure_port: The name of the primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The name of the secondary port. + :vartype secondary_azure_port: str + :ivar s_tag: The identifier of the circuit traffic. + :vartype s_tag: int + :ivar peering_location: The peering location of the ExpressRoute circuit. + :vartype peering_location: str + :ivar bandwidth_in_mbps: The circuit bandwidth In Mbps. + :vartype bandwidth_in_mbps: int + :param express_route_circuit: The ExpressRouteCircuit. + :type express_route_circuit: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitReference + :param service_provider_provisioning_state: The provisioning state of the circuit in the + connectivity provider system. Possible values include: "NotProvisioned", "Provisioning", + "Provisioned", "Deprovisioning". + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2020_07_01.models.ServiceProviderProvisioningState + :param service_provider_notes: Additional read only notes set by the connectivity provider. + :type service_provider_notes: str + :ivar provisioning_state: The provisioning state of the express route cross connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'primary_azure_port': {'readonly': True}, + 'secondary_azure_port': {'readonly': True}, + 's_tag': {'readonly': True}, + 'peering_location': {'readonly': True}, + 'bandwidth_in_mbps': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 's_tag': {'key': 'properties.sTag', 'type': 'int'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'properties.bandwidthInMbps', 'type': 'int'}, + 'express_route_circuit': {'key': 'properties.expressRouteCircuit', 'type': 'ExpressRouteCircuitReference'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCrossConnectionPeering]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCrossConnection, self).__init__(**kwargs) + self.etag = None + self.primary_azure_port = None + self.secondary_azure_port = None + self.s_tag = None + self.peering_location = None + self.bandwidth_in_mbps = None + self.express_route_circuit = kwargs.get('express_route_circuit', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.provisioning_state = None + self.peerings = kwargs.get('peerings', None) + + +class ExpressRouteCrossConnectionListResult(msrest.serialization.Model): + """Response for ListExpressRouteCrossConnection API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of ExpressRouteCrossConnection resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCrossConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCrossConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ExpressRouteCrossConnectionPeering(SubResource): + """Peering in an ExpressRoute Cross Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param peering_type: The peering type. Possible values include: "AzurePublicPeering", + "AzurePrivatePeering", "MicrosoftPeering". + :type peering_type: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringState + :ivar azure_asn: The Azure ASN. + :vartype azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :ivar primary_azure_port: The primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The secondary port. + :vartype secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringConfig + :ivar provisioning_state: The provisioning state of the express route cross connection peering + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar last_modified_by: Who was the last to modify the peering. + :vartype last_modified_by: str + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_07_01.models.Ipv6ExpressRouteCircuitPeeringConfig + """ + + _validation = { + 'etag': {'readonly': True}, + 'azure_asn': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'primary_azure_port': {'readonly': True}, + 'secondary_azure_port': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCrossConnectionPeering, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = None + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = None + self.secondary_azure_port = None + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.provisioning_state = None + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = None + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + + +class ExpressRouteCrossConnectionPeeringList(msrest.serialization.Model): + """Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The peerings in an express route cross connection. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCrossConnectionPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCrossConnectionPeeringList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ExpressRouteCrossConnectionRoutesTableSummary(msrest.serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: IP address of Neighbor router. + :type neighbor: str + :param asn: Autonomous system number. + :type asn: int + :param up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :type up_down: str + :param state_or_prefixes_received: Current state of the BGP session, and the number of prefixes + that have been received from a neighbor or peer group. + :type state_or_prefixes_received: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_or_prefixes_received': {'key': 'stateOrPrefixesReceived', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCrossConnectionRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.asn = kwargs.get('asn', None) + self.up_down = kwargs.get('up_down', None) + self.state_or_prefixes_received = kwargs.get('state_or_prefixes_received', None) + + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResult(msrest.serialization.Model): + """Response for ListRoutesTable associated with the Express Route Cross Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionRoutesTableSummary] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCrossConnectionRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteCrossConnectionsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ExpressRouteGateway(Resource): + """ExpressRoute gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param auto_scale_configuration: Configuration for auto scaling. + :type auto_scale_configuration: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection] + :ivar provisioning_state: The provisioning state of the express route gateway resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param virtual_hub: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.VirtualHubId + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'express_route_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'auto_scale_configuration': {'key': 'properties.autoScaleConfiguration', 'type': 'ExpressRouteGatewayPropertiesAutoScaleConfiguration'}, + 'express_route_connections': {'key': 'properties.expressRouteConnections', 'type': '[ExpressRouteConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'VirtualHubId'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteGateway, self).__init__(**kwargs) + self.etag = None + self.auto_scale_configuration = kwargs.get('auto_scale_configuration', None) + self.express_route_connections = None + self.provisioning_state = None + self.virtual_hub = kwargs.get('virtual_hub', None) + + +class ExpressRouteGatewayList(msrest.serialization.Model): + """List of ExpressRoute gateways. + + :param value: List of ExpressRoute gateways. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteGateway]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteGatewayList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ExpressRouteGatewayPropertiesAutoScaleConfiguration(msrest.serialization.Model): + """Configuration for auto scaling. + + :param bounds: Minimum and maximum number of scale units to deploy. + :type bounds: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + """ + + _attribute_map = { + 'bounds': {'key': 'bounds', 'type': 'ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteGatewayPropertiesAutoScaleConfiguration, self).__init__(**kwargs) + self.bounds = kwargs.get('bounds', None) + + +class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds(msrest.serialization.Model): + """Minimum and maximum number of scale units to deploy. + + :param min: Minimum number of scale units deployed for ExpressRoute gateway. + :type min: int + :param max: Maximum number of scale units deployed for ExpressRoute gateway. + :type max: int + """ + + _attribute_map = { + 'min': {'key': 'min', 'type': 'int'}, + 'max': {'key': 'max', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds, self).__init__(**kwargs) + self.min = kwargs.get('min', None) + self.max = kwargs.get('max', None) + + +class ExpressRouteLink(SubResource): + """ExpressRouteLink child resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of child port resource that is unique among child port resources of the + parent. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar router_name: Name of Azure router associated with physical port. + :vartype router_name: str + :ivar interface_name: Name of Azure router interface. + :vartype interface_name: str + :ivar patch_panel_id: Mapping between physical port to patch panel port. + :vartype patch_panel_id: str + :ivar rack_id: Mapping of physical patch panel to rack. + :vartype rack_id: str + :ivar connector_type: Physical fiber port type. Possible values include: "LC", "SC". + :vartype connector_type: str or + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkConnectorType + :param admin_state: Administrative state of the physical port. Possible values include: + "Enabled", "Disabled". + :type admin_state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkAdminState + :ivar provisioning_state: The provisioning state of the express route link resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param mac_sec_config: MacSec configuration. + :type mac_sec_config: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkMacSecConfig + """ + + _validation = { + 'etag': {'readonly': True}, + 'router_name': {'readonly': True}, + 'interface_name': {'readonly': True}, + 'patch_panel_id': {'readonly': True}, + 'rack_id': {'readonly': True}, + 'connector_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'router_name': {'key': 'properties.routerName', 'type': 'str'}, + 'interface_name': {'key': 'properties.interfaceName', 'type': 'str'}, + 'patch_panel_id': {'key': 'properties.patchPanelId', 'type': 'str'}, + 'rack_id': {'key': 'properties.rackId', 'type': 'str'}, + 'connector_type': {'key': 'properties.connectorType', 'type': 'str'}, + 'admin_state': {'key': 'properties.adminState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'mac_sec_config': {'key': 'properties.macSecConfig', 'type': 'ExpressRouteLinkMacSecConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteLink, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.router_name = None + self.interface_name = None + self.patch_panel_id = None + self.rack_id = None + self.connector_type = None + self.admin_state = kwargs.get('admin_state', None) + self.provisioning_state = None + self.mac_sec_config = kwargs.get('mac_sec_config', None) + + +class ExpressRouteLinkListResult(msrest.serialization.Model): + """Response for ListExpressRouteLinks API service call. + + :param value: The list of ExpressRouteLink sub-resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteLink] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteLinkListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteLinkMacSecConfig(msrest.serialization.Model): + """ExpressRouteLink Mac Security Configuration. + + :param ckn_secret_identifier: Keyvault Secret Identifier URL containing Mac security CKN key. + :type ckn_secret_identifier: str + :param cak_secret_identifier: Keyvault Secret Identifier URL containing Mac security CAK key. + :type cak_secret_identifier: str + :param cipher: Mac security cipher. Possible values include: "GcmAes256", "GcmAes128", + "GcmAesXpn128", "GcmAesXpn256". + :type cipher: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkMacSecCipher + :param sci_state: Sci mode enabled/disabled. Possible values include: "Disabled", "Enabled". + :type sci_state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkMacSecSciState + """ + + _attribute_map = { + 'ckn_secret_identifier': {'key': 'cknSecretIdentifier', 'type': 'str'}, + 'cak_secret_identifier': {'key': 'cakSecretIdentifier', 'type': 'str'}, + 'cipher': {'key': 'cipher', 'type': 'str'}, + 'sci_state': {'key': 'sciState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteLinkMacSecConfig, self).__init__(**kwargs) + self.ckn_secret_identifier = kwargs.get('ckn_secret_identifier', None) + self.cak_secret_identifier = kwargs.get('cak_secret_identifier', None) + self.cipher = kwargs.get('cipher', None) + self.sci_state = kwargs.get('sci_state', None) + + +class ExpressRoutePort(Resource): + """ExpressRoutePort resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param identity: The identity of ExpressRoutePort, if configured. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :param peering_location: The name of the peering location that the ExpressRoutePort is mapped + to physically. + :type peering_location: str + :param bandwidth_in_gbps: Bandwidth of procured ports in Gbps. + :type bandwidth_in_gbps: int + :ivar provisioned_bandwidth_in_gbps: Aggregate Gbps of associated circuit bandwidths. + :vartype provisioned_bandwidth_in_gbps: float + :ivar mtu: Maximum transmission unit of the physical port pair(s). + :vartype mtu: str + :param encapsulation: Encapsulation method on physical ports. Possible values include: "Dot1Q", + "QinQ". + :type encapsulation: str or + ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsEncapsulation + :ivar ether_type: Ether type of the physical port. + :vartype ether_type: str + :ivar allocation_date: Date of the physical port allocation to be used in Letter of + Authorization. + :vartype allocation_date: str + :param links: The set of physical links of the ExpressRoutePort resource. + :type links: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the express route port resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar resource_guid: The resource GUID property of the express route port resource. + :vartype resource_guid: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioned_bandwidth_in_gbps': {'readonly': True}, + 'mtu': {'readonly': True}, + 'ether_type': {'readonly': True}, + 'allocation_date': {'readonly': True}, + 'circuits': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'bandwidth_in_gbps': {'key': 'properties.bandwidthInGbps', 'type': 'int'}, + 'provisioned_bandwidth_in_gbps': {'key': 'properties.provisionedBandwidthInGbps', 'type': 'float'}, + 'mtu': {'key': 'properties.mtu', 'type': 'str'}, + 'encapsulation': {'key': 'properties.encapsulation', 'type': 'str'}, + 'ether_type': {'key': 'properties.etherType', 'type': 'str'}, + 'allocation_date': {'key': 'properties.allocationDate', 'type': 'str'}, + 'links': {'key': 'properties.links', 'type': '[ExpressRouteLink]'}, + 'circuits': {'key': 'properties.circuits', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRoutePort, self).__init__(**kwargs) + self.etag = None + self.identity = kwargs.get('identity', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_gbps = kwargs.get('bandwidth_in_gbps', None) + self.provisioned_bandwidth_in_gbps = None + self.mtu = None + self.encapsulation = kwargs.get('encapsulation', None) + self.ether_type = None + self.allocation_date = None + self.links = kwargs.get('links', None) + self.circuits = None + self.provisioning_state = None + self.resource_guid = None + + +class ExpressRoutePortListResult(msrest.serialization.Model): + """Response for ListExpressRoutePorts API service call. + + :param value: A list of ExpressRoutePort resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRoutePort]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRoutePortListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRoutePortsLocation(Resource): + """Definition of the ExpressRoutePorts peering location resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar address: Address of peering location. + :vartype address: str + :ivar contact: Contact details of peering locations. + :vartype contact: str + :param available_bandwidths: The inventory of available ExpressRoutePort bandwidths. + :type available_bandwidths: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocationBandwidths] + :ivar provisioning_state: The provisioning state of the express route port location resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'address': {'readonly': True}, + 'contact': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address': {'key': 'properties.address', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'str'}, + 'available_bandwidths': {'key': 'properties.availableBandwidths', 'type': '[ExpressRoutePortsLocationBandwidths]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRoutePortsLocation, self).__init__(**kwargs) + self.address = None + self.contact = None + self.available_bandwidths = kwargs.get('available_bandwidths', None) + self.provisioning_state = None + + +class ExpressRoutePortsLocationBandwidths(msrest.serialization.Model): + """Real-time inventory of available ExpressRoute port bandwidths. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar offer_name: Bandwidth descriptive name. + :vartype offer_name: str + :ivar value_in_gbps: Bandwidth value in Gbps. + :vartype value_in_gbps: int + """ + + _validation = { + 'offer_name': {'readonly': True}, + 'value_in_gbps': {'readonly': True}, + } + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_gbps': {'key': 'valueInGbps', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRoutePortsLocationBandwidths, self).__init__(**kwargs) + self.offer_name = None + self.value_in_gbps = None + + +class ExpressRoutePortsLocationListResult(msrest.serialization.Model): + """Response for ListExpressRoutePortsLocations API service call. + + :param value: The list of all ExpressRoutePort peering locations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocation] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRoutePortsLocation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRoutePortsLocationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param peering_locations: A list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: A list of bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :ivar provisioning_state: The provisioning state of the express route service provider + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = None + + +class ExpressRouteServiceProviderBandwidthsOffered(msrest.serialization.Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) + + +class ExpressRouteServiceProviderListResult(msrest.serialization.Model): + """Response for the ListExpressRouteServiceProvider API service call. + + :param value: A list of ExpressRouteResourceProvider resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteServiceProvider] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteServiceProvider]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteServiceProviderListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExtendedLocation(msrest.serialization.Model): + """ExtendedLocation complex type. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the extended location. + :type name: str + :param type: Required. The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.ExtendedLocationTypes + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class FirewallPolicy(Resource): + """FirewallPolicy Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param identity: The identity of the firewall policy. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the firewall policy resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param base_policy: The parent firewall policy from which rules are inherited. + :type base_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar firewalls: List of references to Azure Firewalls that this Firewall Policy is associated + with. + :vartype firewalls: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param threat_intel_mode: The operation mode for Threat Intelligence. Possible values include: + "Alert", "Deny", "Off". + :type threat_intel_mode: str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallThreatIntelMode + :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :type threat_intel_whitelist: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyThreatIntelWhitelist + :param dns_settings: DNS Proxy Settings definition. + :type dns_settings: ~azure.mgmt.network.v2020_07_01.models.DnsSettings + :param intrusion_detection: The configuration for Intrusion detection. + :type intrusion_detection: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetection + :param transport_security: TLS Configuration definition. + :type transport_security: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyTransportSecurity + :param sku: The Firewall Policy SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicySku + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'rule_collection_groups': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'readonly': True}, + 'child_policies': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'rule_collection_groups': {'key': 'properties.ruleCollectionGroups', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'base_policy': {'key': 'properties.basePolicy', 'type': 'SubResource'}, + 'firewalls': {'key': 'properties.firewalls', 'type': '[SubResource]'}, + 'child_policies': {'key': 'properties.childPolicies', 'type': '[SubResource]'}, + 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, + 'threat_intel_whitelist': {'key': 'properties.threatIntelWhitelist', 'type': 'FirewallPolicyThreatIntelWhitelist'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'DnsSettings'}, + 'intrusion_detection': {'key': 'properties.intrusionDetection', 'type': 'FirewallPolicyIntrusionDetection'}, + 'transport_security': {'key': 'properties.transportSecurity', 'type': 'FirewallPolicyTransportSecurity'}, + 'sku': {'key': 'properties.sku', 'type': 'FirewallPolicySku'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicy, self).__init__(**kwargs) + self.etag = None + self.identity = kwargs.get('identity', None) + self.rule_collection_groups = None + self.provisioning_state = None + self.base_policy = kwargs.get('base_policy', None) + self.firewalls = None + self.child_policies = None + self.threat_intel_mode = kwargs.get('threat_intel_mode', None) + self.threat_intel_whitelist = kwargs.get('threat_intel_whitelist', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.intrusion_detection = kwargs.get('intrusion_detection', None) + self.transport_security = kwargs.get('transport_security', None) + self.sku = kwargs.get('sku', None) + + +class FirewallPolicyCertificateAuthority(msrest.serialization.Model): + """Trusted Root certificates properties for tls. + + :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :type key_vault_secret_id: str + :param name: Name of the CA certificate. + :type name: str + """ + + _attribute_map = { + 'key_vault_secret_id': {'key': 'keyVaultSecretId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyCertificateAuthority, self).__init__(**kwargs) + self.key_vault_secret_id = kwargs.get('key_vault_secret_id', None) + self.name = kwargs.get('name', None) + + +class FirewallPolicyRuleCollection(msrest.serialization.Model): + """Properties of the rule collection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FirewallPolicyFilterRuleCollection, FirewallPolicyNatRuleCollection. + + All required parameters must be populated in order to send to Azure. + + :param rule_collection_type: Required. The type of the rule collection.Constant filled by + server. Possible values include: "FirewallPolicyNatRuleCollection", + "FirewallPolicyFilterRuleCollection". + :type rule_collection_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionType + :param name: The name of the rule collection. + :type name: str + :param priority: Priority of the Firewall Policy Rule Collection resource. + :type priority: int + """ + + _validation = { + 'rule_collection_type': {'required': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + } + + _attribute_map = { + 'rule_collection_type': {'key': 'ruleCollectionType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + } + + _subtype_map = { + 'rule_collection_type': {'FirewallPolicyFilterRuleCollection': 'FirewallPolicyFilterRuleCollection', 'FirewallPolicyNatRuleCollection': 'FirewallPolicyNatRuleCollection'} + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyRuleCollection, self).__init__(**kwargs) + self.rule_collection_type = None # type: Optional[str] + self.name = kwargs.get('name', None) + self.priority = kwargs.get('priority', None) + + +class FirewallPolicyFilterRuleCollection(FirewallPolicyRuleCollection): + """Firewall Policy Filter Rule Collection. + + All required parameters must be populated in order to send to Azure. + + :param rule_collection_type: Required. The type of the rule collection.Constant filled by + server. Possible values include: "FirewallPolicyNatRuleCollection", + "FirewallPolicyFilterRuleCollection". + :type rule_collection_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionType + :param name: The name of the rule collection. + :type name: str + :param priority: Priority of the Firewall Policy Rule Collection resource. + :type priority: int + :param action: The action type of a Filter rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyFilterRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRule] + """ + + _validation = { + 'rule_collection_type': {'required': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + } + + _attribute_map = { + 'rule_collection_type': {'key': 'ruleCollectionType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'FirewallPolicyFilterRuleCollectionAction'}, + 'rules': {'key': 'rules', 'type': '[FirewallPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyFilterRuleCollection, self).__init__(**kwargs) + self.rule_collection_type = 'FirewallPolicyFilterRuleCollection' # type: str + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + + +class FirewallPolicyFilterRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyFilterRuleCollectionAction. + + :param type: The type of action. Possible values include: "Allow", "Deny". + :type type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyFilterRuleCollectionActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyFilterRuleCollectionAction, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class FirewallPolicyIntrusionDetection(msrest.serialization.Model): + """Configuration for intrusion detection mode and rules. + + :param mode: Intrusion detection general state. Possible values include: "Off", "Alert", + "Deny". + :type mode: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionStateType + :param configuration: Intrusion detection configuration properties. + :type configuration: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionConfiguration + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'FirewallPolicyIntrusionDetectionConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyIntrusionDetection, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + self.configuration = kwargs.get('configuration', None) + + +class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications(msrest.serialization.Model): + """Intrusion detection bypass traffic specification. + + :param name: Name of the bypass traffic rule. + :type name: str + :param description: Description of the bypass traffic rule. + :type description: str + :param protocol: The rule bypass protocol. Possible values include: "TCP", "UDP", "ICMP", + "ANY". + :type protocol: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionProtocol + :param source_addresses: List of source IP addresses or ranges for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or ranges for this rule. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports or ranges. + :type destination_ports: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param destination_ip_groups: List of destination IpGroups for this rule. + :type destination_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'destination_ip_groups': {'key': 'destinationIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyIntrusionDetectionBypassTrafficSpecifications, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.destination_ports = kwargs.get('destination_ports', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + self.destination_ip_groups = kwargs.get('destination_ip_groups', None) + + +class FirewallPolicyIntrusionDetectionConfiguration(msrest.serialization.Model): + """The operation for configuring intrusion detection. + + :param signature_overrides: List of specific signatures states. + :type signature_overrides: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionSignatureSpecification] + :param bypass_traffic_settings: List of rules for traffic to bypass. + :type bypass_traffic_settings: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications] + """ + + _attribute_map = { + 'signature_overrides': {'key': 'signatureOverrides', 'type': '[FirewallPolicyIntrusionDetectionSignatureSpecification]'}, + 'bypass_traffic_settings': {'key': 'bypassTrafficSettings', 'type': '[FirewallPolicyIntrusionDetectionBypassTrafficSpecifications]'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyIntrusionDetectionConfiguration, self).__init__(**kwargs) + self.signature_overrides = kwargs.get('signature_overrides', None) + self.bypass_traffic_settings = kwargs.get('bypass_traffic_settings', None) + + +class FirewallPolicyIntrusionDetectionSignatureSpecification(msrest.serialization.Model): + """Intrusion detection signatures specification states. + + :param id: Signature id. + :type id: str + :param mode: The signature state. Possible values include: "Off", "Alert", "Deny". + :type mode: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionStateType + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyIntrusionDetectionSignatureSpecification, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.mode = kwargs.get('mode', None) + + +class FirewallPolicyListResult(msrest.serialization.Model): + """Response for ListFirewallPolicies API service call. + + :param value: List of Firewall Policies in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicy] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FirewallPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class FirewallPolicyNatRuleCollection(FirewallPolicyRuleCollection): + """Firewall Policy NAT Rule Collection. + + All required parameters must be populated in order to send to Azure. + + :param rule_collection_type: Required. The type of the rule collection.Constant filled by + server. Possible values include: "FirewallPolicyNatRuleCollection", + "FirewallPolicyFilterRuleCollection". + :type rule_collection_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionType + :param name: The name of the rule collection. + :type name: str + :param priority: Priority of the Firewall Policy Rule Collection resource. + :type priority: int + :param action: The action type of a Nat rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyNatRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRule] + """ + + _validation = { + 'rule_collection_type': {'required': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + } + + _attribute_map = { + 'rule_collection_type': {'key': 'ruleCollectionType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'FirewallPolicyNatRuleCollectionAction'}, + 'rules': {'key': 'rules', 'type': '[FirewallPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyNatRuleCollection, self).__init__(**kwargs) + self.rule_collection_type = 'FirewallPolicyNatRuleCollection' # type: str + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + + +class FirewallPolicyNatRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + :param type: The type of action. Possible values include: "DNAT". + :type type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyNatRuleCollectionActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyNatRuleCollectionAction, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class FirewallPolicyRuleApplicationProtocol(msrest.serialization.Model): + """Properties of the application rule protocol. + + :param protocol_type: Protocol type. Possible values include: "Http", "Https". + :type protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleApplicationProtocolType + :param port: Port number for the protocol, cannot be greater than 64000. + :type port: int + """ + + _validation = { + 'port': {'maximum': 64000, 'minimum': 0}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyRuleApplicationProtocol, self).__init__(**kwargs) + self.protocol_type = kwargs.get('protocol_type', None) + self.port = kwargs.get('port', None) + + +class FirewallPolicyRuleCollectionGroup(SubResource): + """Rule Collection Group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Rule Group type. + :vartype type: str + :param priority: Priority of the Firewall Policy Rule Collection Group resource. + :type priority: int + :param rule_collections: Group of Firewall Policy rule collections. + :type rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollection] + :ivar provisioning_state: The provisioning state of the firewall policy rule collection group + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'rule_collections': {'key': 'properties.ruleCollections', 'type': '[FirewallPolicyRuleCollection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyRuleCollectionGroup, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.priority = kwargs.get('priority', None) + self.rule_collections = kwargs.get('rule_collections', None) + self.provisioning_state = None + + +class FirewallPolicyRuleCollectionGroupListResult(msrest.serialization.Model): + """Response for ListFirewallPolicyRuleCollectionGroups API service call. + + :param value: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FirewallPolicyRuleCollectionGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyRuleCollectionGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class FirewallPolicySku(msrest.serialization.Model): + """SKU of Firewall policy. + + :param tier: Tier of Firewall Policy. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicySkuTier + """ + + _attribute_map = { + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicySku, self).__init__(**kwargs) + self.tier = kwargs.get('tier', None) + + +class FirewallPolicyThreatIntelWhitelist(msrest.serialization.Model): + """ThreatIntel Whitelist for Firewall Policy. + + :param ip_addresses: List of IP addresses for the ThreatIntel Whitelist. + :type ip_addresses: list[str] + :param fqdns: List of FQDNs for the ThreatIntel Whitelist. + :type fqdns: list[str] + """ + + _attribute_map = { + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyThreatIntelWhitelist, self).__init__(**kwargs) + self.ip_addresses = kwargs.get('ip_addresses', None) + self.fqdns = kwargs.get('fqdns', None) + + +class FirewallPolicyTransportSecurity(msrest.serialization.Model): + """Configuration needed to perform TLS termination & initiation. + + :param certificate_authority: The CA used for intermediate CA generation. + :type certificate_authority: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyCertificateAuthority + """ + + _attribute_map = { + 'certificate_authority': {'key': 'certificateAuthority', 'type': 'FirewallPolicyCertificateAuthority'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyTransportSecurity, self).__init__(**kwargs) + self.certificate_authority = kwargs.get('certificate_authority', None) + + +class FlowLog(Resource): + """A flow log resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param target_resource_id: ID of network security group to which flow log will be applied. + :type target_resource_id: str + :ivar target_resource_guid: Guid of network security group to which flow log will be applied. + :vartype target_resource_guid: str + :param storage_id: ID of the storage account which is used to store the flow log. + :type storage_id: str + :param enabled: Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: Parameters that define the retention policy for flow log. + :type retention_policy: ~azure.mgmt.network.v2020_07_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_07_01.models.FlowLogFormatParameters + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_07_01.models.TrafficAnalyticsProperties + :ivar provisioning_state: The provisioning state of the flow log. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'target_resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'}, + 'target_resource_guid': {'key': 'properties.targetResourceGuid', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + 'format': {'key': 'properties.format', 'type': 'FlowLogFormatParameters'}, + 'flow_analytics_configuration': {'key': 'properties.flowAnalyticsConfiguration', 'type': 'TrafficAnalyticsProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowLog, self).__init__(**kwargs) + self.etag = None + self.target_resource_id = kwargs.get('target_resource_id', None) + self.target_resource_guid = None + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) + self.format = kwargs.get('format', None) + self.flow_analytics_configuration = kwargs.get('flow_analytics_configuration', None) + self.provisioning_state = None + + +class FlowLogFormatParameters(msrest.serialization.Model): + """Parameters that define the flow log format. + + :param type: The file type of flow log. Possible values include: "JSON". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.FlowLogFormatType + :param version: The version (revision) of the flow log. + :type version: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowLogFormatParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.version = kwargs.get('version', 0) + + +class FlowLogInformation(msrest.serialization.Model): + """Information on the configuration of flow log and traffic analytics (optional) . + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure for flow log and + traffic analytics (optional) . + :type target_resource_id: str + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_07_01.models.TrafficAnalyticsProperties + :param storage_id: Required. ID of the storage account which is used to store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: Parameters that define the retention policy for flow log. + :type retention_policy: ~azure.mgmt.network.v2020_07_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_07_01.models.FlowLogFormatParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'flow_analytics_configuration': {'key': 'flowAnalyticsConfiguration', 'type': 'TrafficAnalyticsProperties'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + 'format': {'key': 'properties.format', 'type': 'FlowLogFormatParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.flow_analytics_configuration = kwargs.get('flow_analytics_configuration', None) + self.storage_id = kwargs['storage_id'] + self.enabled = kwargs['enabled'] + self.retention_policy = kwargs.get('retention_policy', None) + self.format = kwargs.get('format', None) + + +class FlowLogListResult(msrest.serialization.Model): + """List of flow logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Information about flow log resource. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FlowLog] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FlowLog]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowLogListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class FlowLogStatusParameters(msrest.serialization.Model): + """Parameters that define a resource to query flow log and traffic analytics (optional) status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the flow log and traffic + analytics (optional) status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of frontend IP + configurations used by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :ivar inbound_nat_rules: An array of references to inbound rules that use this frontend IP. + :vartype inbound_nat_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar inbound_nat_pools: An array of references to inbound pools that use this frontend IP. + :vartype inbound_nat_pools: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar outbound_rules: An array of references to outbound rules that use this frontend IP. + :vartype outbound_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar load_balancing_rules: An array of references to load balancing rules that use this + frontend IP. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. Possible values include: + "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param private_ip_address_version: Whether the specific ipconfiguration is IPv4 or IPv6. + Default is taken as IPv4. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param public_ip_address: The reference to the Public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :param public_ip_prefix: The reference to the Public IP Prefix resource. + :type public_ip_prefix: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the frontend IP configuration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_rules': {'key': 'properties.outboundRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FrontendIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.zones = kwargs.get('zones', None) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_rules = None + self.load_balancing_rules = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.public_ip_prefix = kwargs.get('public_ip_prefix', None) + self.provisioning_state = None + + +class GatewayRoute(msrest.serialization.Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The gateway's local address. + :vartype local_address: str + :ivar network: The route's network prefix. + :vartype network: str + :ivar next_hop: The route's next hop. + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from. + :vartype source_peer: str + :ivar origin: The source this route was learned from. + :vartype origin: str + :ivar as_path: The route's AS path sequence. + :vartype as_path: str + :ivar weight: The route's weight. + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None + + +class GatewayRouteListResult(msrest.serialization.Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes. + :type value: list[~azure.mgmt.network.v2020_07_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__( + self, + **kwargs + ): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class GenerateExpressRoutePortsLOARequest(msrest.serialization.Model): + """The customer name to be printed on a letter of authorization. + + All required parameters must be populated in order to send to Azure. + + :param customer_name: Required. The customer name. + :type customer_name: str + """ + + _validation = { + 'customer_name': {'required': True}, + } + + _attribute_map = { + 'customer_name': {'key': 'customerName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateExpressRoutePortsLOARequest, self).__init__(**kwargs) + self.customer_name = kwargs['customer_name'] + + +class GenerateExpressRoutePortsLOAResult(msrest.serialization.Model): + """Response for GenerateExpressRoutePortsLOA API service call. + + :param encoded_content: The content as a base64 encoded string. + :type encoded_content: str + """ + + _attribute_map = { + 'encoded_content': {'key': 'encodedContent', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateExpressRoutePortsLOAResult, self).__init__(**kwargs) + self.encoded_content = kwargs.get('encoded_content', None) + + +class GetVpnSitesConfigurationRequest(msrest.serialization.Model): + """List of Vpn-Sites. + + All required parameters must be populated in order to send to Azure. + + :param vpn_sites: List of resource-ids of the vpn-sites for which config is to be downloaded. + :type vpn_sites: list[str] + :param output_blob_sas_url: Required. The sas-url to download the configurations for vpn-sites. + :type output_blob_sas_url: str + """ + + _validation = { + 'output_blob_sas_url': {'required': True}, + } + + _attribute_map = { + 'vpn_sites': {'key': 'vpnSites', 'type': '[str]'}, + 'output_blob_sas_url': {'key': 'outputBlobSasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GetVpnSitesConfigurationRequest, self).__init__(**kwargs) + self.vpn_sites = kwargs.get('vpn_sites', None) + self.output_blob_sas_url = kwargs['output_blob_sas_url'] + + +class HopLink(msrest.serialization.Model): + """Hop link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar next_hop_id: The ID of the next hop. + :vartype next_hop_id: str + :ivar link_type: Link type. + :vartype link_type: str + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityIssue] + :ivar context: Provides additional context on links. + :vartype context: dict[str, str] + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar round_trip_time_min: Minimum roundtrip time in milliseconds. + :vartype round_trip_time_min: long + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: long + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: long + """ + + _validation = { + 'next_hop_id': {'readonly': True}, + 'link_type': {'readonly': True}, + 'issues': {'readonly': True}, + 'context': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'round_trip_time_min': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + 'round_trip_time_avg': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + 'round_trip_time_max': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + } + + _attribute_map = { + 'next_hop_id': {'key': 'nextHopId', 'type': 'str'}, + 'link_type': {'key': 'linkType', 'type': 'str'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + 'context': {'key': 'context', 'type': '{str}'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'round_trip_time_min': {'key': 'properties.roundTripTimeMin', 'type': 'long'}, + 'round_trip_time_avg': {'key': 'properties.roundTripTimeAvg', 'type': 'long'}, + 'round_trip_time_max': {'key': 'properties.roundTripTimeMax', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(HopLink, self).__init__(**kwargs) + self.next_hop_id = None + self.link_type = None + self.issues = None + self.context = None + self.resource_id = None + self.round_trip_time_min = None + self.round_trip_time_avg = None + self.round_trip_time_max = None + + +class HTTPConfiguration(msrest.serialization.Model): + """HTTP configuration of the connectivity check. + + :param method: HTTP method. Possible values include: "Get". + :type method: str or ~azure.mgmt.network.v2020_07_01.models.HTTPMethod + :param headers: List of HTTP headers. + :type headers: list[~azure.mgmt.network.v2020_07_01.models.HTTPHeader] + :param valid_status_codes: Valid status codes. + :type valid_status_codes: list[int] + """ + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '[HTTPHeader]'}, + 'valid_status_codes': {'key': 'validStatusCodes', 'type': '[int]'}, + } + + def __init__( + self, + **kwargs + ): + super(HTTPConfiguration, self).__init__(**kwargs) + self.method = kwargs.get('method', None) + self.headers = kwargs.get('headers', None) + self.valid_status_codes = kwargs.get('valid_status_codes', None) + + +class HTTPHeader(msrest.serialization.Model): + """The HTTP header. + + :param name: The name in HTTP header. + :type name: str + :param value: The value in HTTP header. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HTTPHeader, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class HubIPAddresses(msrest.serialization.Model): + """IP addresses associated with azure firewall. + + :param public_i_ps: Public IP addresses associated with azure firewall. + :type public_i_ps: ~azure.mgmt.network.v2020_07_01.models.HubPublicIPAddresses + :param private_ip_address: Private IP Address associated with azure firewall. + :type private_ip_address: str + """ + + _attribute_map = { + 'public_i_ps': {'key': 'publicIPs', 'type': 'HubPublicIPAddresses'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HubIPAddresses, self).__init__(**kwargs) + self.public_i_ps = kwargs.get('public_i_ps', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + + +class HubIpConfiguration(SubResource): + """IpConfigurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the Ip Configuration. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Ipconfiguration type. + :vartype type: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :ivar provisioning_state: The provisioning state of the IP configuration resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HubIpConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = None + + +class HubPublicIPAddresses(msrest.serialization.Model): + """Public IP addresses associated with azure firewall. + + :param addresses: The list of Public IP addresses associated with azure firewall or IP + addresses to be retained. + :type addresses: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallPublicIPAddress] + :param count: The number of Public IP addresses associated with azure firewall. + :type count: int + """ + + _attribute_map = { + 'addresses': {'key': 'addresses', 'type': '[AzureFirewallPublicIPAddress]'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HubPublicIPAddresses, self).__init__(**kwargs) + self.addresses = kwargs.get('addresses', None) + self.count = kwargs.get('count', None) + + +class HubRoute(msrest.serialization.Model): + """RouteTable route. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Route that is unique within a RouteTable. This name can + be used to access this route. + :type name: str + :param destination_type: Required. The type of destinations (eg: CIDR, ResourceId, Service). + :type destination_type: str + :param destinations: Required. List of all destinations. + :type destinations: list[str] + :param next_hop_type: Required. The type of next hop (eg: ResourceId). + :type next_hop_type: str + :param next_hop: Required. NextHop resource ID. + :type next_hop: str + """ + + _validation = { + 'name': {'required': True}, + 'destination_type': {'required': True}, + 'destinations': {'required': True}, + 'next_hop_type': {'required': True}, + 'next_hop': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'destination_type': {'key': 'destinationType', 'type': 'str'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HubRoute, self).__init__(**kwargs) + self.name = kwargs['name'] + self.destination_type = kwargs['destination_type'] + self.destinations = kwargs['destinations'] + self.next_hop_type = kwargs['next_hop_type'] + self.next_hop = kwargs['next_hop'] + + +class HubRouteTable(SubResource): + """RouteTable resource in a virtual hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param routes: List of all routes. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.HubRoute] + :param labels: List of labels associated with this route table. + :type labels: list[str] + :ivar associated_connections: List of all connections associated with this route table. + :vartype associated_connections: list[str] + :ivar propagating_connections: List of all connections that advertise to this route table. + :vartype propagating_connections: list[str] + :ivar provisioning_state: The provisioning state of the RouteTable resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'associated_connections': {'readonly': True}, + 'propagating_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[HubRoute]'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'associated_connections': {'key': 'properties.associatedConnections', 'type': '[str]'}, + 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HubRouteTable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.routes = kwargs.get('routes', None) + self.labels = kwargs.get('labels', None) + self.associated_connections = None + self.propagating_connections = None + self.provisioning_state = None + + +class HubVirtualNetworkConnection(SubResource): + """HubVirtualNetworkConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param remote_virtual_network: Reference to the remote virtual network. + :type remote_virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param allow_hub_to_remote_vnet_transit: Deprecated: VirtualHub to RemoteVnet transit to + enabled or not. + :type allow_hub_to_remote_vnet_transit: bool + :param allow_remote_vnet_to_use_hub_vnet_gateways: Deprecated: Allow RemoteVnet to use Virtual + Hub's gateways. + :type allow_remote_vnet_to_use_hub_vnet_gateways: bool + :param enable_internet_security: Enable internet security. + :type enable_internet_security: bool + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + :ivar provisioning_state: The provisioning state of the hub virtual network connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'allow_hub_to_remote_vnet_transit': {'key': 'properties.allowHubToRemoteVnetTransit', 'type': 'bool'}, + 'allow_remote_vnet_to_use_hub_vnet_gateways': {'key': 'properties.allowRemoteVnetToUseHubVnetGateways', 'type': 'bool'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HubVirtualNetworkConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.allow_hub_to_remote_vnet_transit = kwargs.get('allow_hub_to_remote_vnet_transit', None) + self.allow_remote_vnet_to_use_hub_vnet_gateways = kwargs.get('allow_remote_vnet_to_use_hub_vnet_gateways', None) + self.enable_internet_security = kwargs.get('enable_internet_security', None) + self.routing_configuration = kwargs.get('routing_configuration', None) + self.provisioning_state = None + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of inbound NAT pools used + by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protocol: The reference to the transport protocol used by the inbound NAT pool. Possible + values include: "Udp", "Tcp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.TransportProtocol + :param frontend_port_range_start: The first port number in the range of external ports that + will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values + range between 1 and 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: The last port number in the range of external ports that will + be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range + between 1 and 65535. + :type frontend_port_range_end: int + :param backend_port: The port used for internal connections on the endpoint. Acceptable values + are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :type enable_floating_ip: bool + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :ivar provisioning_state: The provisioning state of the inbound NAT pool resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundNatPool, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) + self.provisioning_state = None + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of inbound NAT rules used + by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address defined on a network + interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations + is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :param protocol: The reference to the transport protocol used by the load balancing rule. + Possible values include: "Udp", "Tcp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values range from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable values range from 1 to + 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :type enable_floating_ip: bool + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :ivar provisioning_state: The provisioning state of the inbound NAT rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'backend_ip_configuration': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundNatRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_ip_configuration = None + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) + self.provisioning_state = None + + +class InboundNatRuleListResult(msrest.serialization.Model): + """Response for ListInboundNatRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of inbound nat rules in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundNatRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundNatRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class InboundSecurityRule(SubResource): + """NVA Inbound Security Rule resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of security rule collection. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: NVA inbound security rule type. + :vartype type: str + :param rules: List of allowed rules. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.InboundSecurityRules] + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[InboundSecurityRules]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.rules = kwargs.get('rules', None) + self.provisioning_state = None + + +class InboundSecurityRules(msrest.serialization.Model): + """Properties of the Inbound Security Rules resource. + + :param protocol: Protocol. This should be either TCP or UDP. Possible values include: "TCP", + "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.InboundSecurityRulesProtocol + :param source_address_prefix: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are + allowed. + :type source_address_prefix: str + :param destination_port_range: NVA port ranges to be opened up. One needs to provide specific + ports. + :type destination_port_range: int + """ + + _validation = { + 'destination_port_range': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundSecurityRules, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + + +class IPAddressAvailabilityResult(msrest.serialization.Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP addresses if the asked for + address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) + + +class IpAllocation(Resource): + """IpAllocation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar subnet: The Subnet that using the prefix of this IpAllocation resource. + :vartype subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param type_properties_type: The type for the IpAllocation. Possible values include: + "Undefined", "Hypernet". + :type type_properties_type: str or ~azure.mgmt.network.v2020_07_01.models.IpAllocationType + :param prefix: The address prefix for the IpAllocation. + :type prefix: str + :param prefix_length: The address prefix length for the IpAllocation. + :type prefix_length: int + :param prefix_type: The address prefix Type for the IpAllocation. Possible values include: + "IPv4", "IPv6". + :type prefix_type: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param ipam_allocation_id: The IPAM allocation ID. + :type ipam_allocation_id: str + :param allocation_tags: IpAllocation tags. + :type allocation_tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnet': {'readonly': True}, + 'virtual_network': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, + 'prefix_type': {'key': 'properties.prefixType', 'type': 'str'}, + 'ipam_allocation_id': {'key': 'properties.ipamAllocationId', 'type': 'str'}, + 'allocation_tags': {'key': 'properties.allocationTags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAllocation, self).__init__(**kwargs) + self.etag = None + self.subnet = None + self.virtual_network = None + self.type_properties_type = kwargs.get('type_properties_type', None) + self.prefix = kwargs.get('prefix', None) + self.prefix_length = kwargs.get('prefix_length', 0) + self.prefix_type = kwargs.get('prefix_type', None) + self.ipam_allocation_id = kwargs.get('ipam_allocation_id', None) + self.allocation_tags = kwargs.get('allocation_tags', None) + + +class IpAllocationListResult(msrest.serialization.Model): + """Response for the ListIpAllocations API service call. + + :param value: A list of IpAllocation resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.IpAllocation] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IpAllocation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAllocationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IPConfiguration(SubResource): + """IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :ivar provisioning_state: The provisioning state of the IP configuration resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = None + + +class IPConfigurationBgpPeeringAddress(msrest.serialization.Model): + """Properties of IPConfigurationBgpPeeringAddress. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param ipconfiguration_id: The ID of IP configuration which belongs to gateway. + :type ipconfiguration_id: str + :ivar default_bgp_ip_addresses: The list of default BGP peering addresses which belong to IP + configuration. + :vartype default_bgp_ip_addresses: list[str] + :param custom_bgp_ip_addresses: The list of custom BGP peering addresses which belong to IP + configuration. + :type custom_bgp_ip_addresses: list[str] + :ivar tunnel_ip_addresses: The list of tunnel public IP addresses which belong to IP + configuration. + :vartype tunnel_ip_addresses: list[str] + """ + + _validation = { + 'default_bgp_ip_addresses': {'readonly': True}, + 'tunnel_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'ipconfiguration_id': {'key': 'ipconfigurationId', 'type': 'str'}, + 'default_bgp_ip_addresses': {'key': 'defaultBgpIpAddresses', 'type': '[str]'}, + 'custom_bgp_ip_addresses': {'key': 'customBgpIpAddresses', 'type': '[str]'}, + 'tunnel_ip_addresses': {'key': 'tunnelIpAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(IPConfigurationBgpPeeringAddress, self).__init__(**kwargs) + self.ipconfiguration_id = kwargs.get('ipconfiguration_id', None) + self.default_bgp_ip_addresses = None + self.custom_bgp_ip_addresses = kwargs.get('custom_bgp_ip_addresses', None) + self.tunnel_ip_addresses = None + + +class IPConfigurationProfile(SubResource): + """IP configuration profile child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param subnet: The reference to the subnet resource to create a container network interface ip + configuration. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :ivar provisioning_state: The provisioning state of the IP configuration profile resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IPConfigurationProfile, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.etag = None + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = None + + +class IpGroup(Resource): + """The IpGroups resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the IpGroups resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :type ip_addresses: list[str] + :ivar firewalls: List of references to Firewall resources that this IpGroups is associated + with. + :vartype firewalls: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar firewall_policies: List of references to Firewall Policies resources that this IpGroups + is associated with. + :vartype firewall_policies: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'readonly': True}, + 'firewall_policies': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'ip_addresses': {'key': 'properties.ipAddresses', 'type': '[str]'}, + 'firewalls': {'key': 'properties.firewalls', 'type': '[SubResource]'}, + 'firewall_policies': {'key': 'properties.firewallPolicies', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(IpGroup, self).__init__(**kwargs) + self.etag = None + self.provisioning_state = None + self.ip_addresses = kwargs.get('ip_addresses', None) + self.firewalls = None + self.firewall_policies = None + + +class IpGroupListResult(msrest.serialization.Model): + """Response for the ListIpGroups API service call. + + :param value: The list of IpGroups information resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.IpGroup] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IpGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IpsecPolicy(msrest.serialization.Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE phase 1). Possible + values include: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", + "GCMAES256". + :type ipsec_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase 1). Possible values + include: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", "GCMAES256". + :type ipsec_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase 2). Possible values + include: "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", "GCMAES128". + :type ike_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). Possible values + include: "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", "GCMAES128". + :type ike_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IkeIntegrity + :param dh_group: Required. The DH Group used in IKE Phase 1 for initial SA. Possible values + include: "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", + "DHGroup24". + :type dh_group: str or ~azure.mgmt.network.v2020_07_01.models.DhGroup + :param pfs_group: Required. The Pfs Group used in IKE Phase 2 for new child SA. Possible values + include: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", "PFSMM". + :type pfs_group: str or ~azure.mgmt.network.v2020_07_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs['sa_life_time_seconds'] + self.sa_data_size_kilobytes = kwargs['sa_data_size_kilobytes'] + self.ipsec_encryption = kwargs['ipsec_encryption'] + self.ipsec_integrity = kwargs['ipsec_integrity'] + self.ike_encryption = kwargs['ike_encryption'] + self.ike_integrity = kwargs['ike_integrity'] + self.dh_group = kwargs['dh_group'] + self.pfs_group = kwargs['pfs_group'] + + +class IpTag(msrest.serialization.Model): + """Contains the IpTag associated with the object. + + :param ip_tag_type: The IP tag type. Example: FirstPartyUsage. + :type ip_tag_type: str + :param tag: The value of the IP tag associated with the public IP. Example: SQL. + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpTag, self).__init__(**kwargs) + self.ip_tag_type = kwargs.get('ip_tag_type', None) + self.tag = kwargs.get('tag', None) + + +class Ipv6CircuitConnectionConfig(msrest.serialization.Model): + """IPv6 Circuit Connection properties for global reach. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param address_prefix: /125 IP address space to carve out customer addresses for global reach. + :type address_prefix: str + :ivar circuit_connection_status: Express Route Circuit connection state. Possible values + include: "Connected", "Connecting", "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.CircuitConnectionStatus + """ + + _validation = { + 'circuit_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'circuit_connection_status': {'key': 'circuitConnectionStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6CircuitConnectionConfig, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.circuit_connection_status = None + + +class Ipv6ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param state: The state of peering. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'SubResource'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) + + +class ListHubRouteTablesResult(msrest.serialization.Model): + """List of RouteTables and a URL nextLink to get the next set of results. + + :param value: List of RouteTables. + :type value: list[~azure.mgmt.network.v2020_07_01.models.HubRouteTable] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HubRouteTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListHubRouteTablesResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListHubVirtualNetworkConnectionsResult(msrest.serialization.Model): + """List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + + :param value: List of HubVirtualNetworkConnections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HubVirtualNetworkConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListHubVirtualNetworkConnectionsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListP2SVpnGatewaysResult(msrest.serialization.Model): + """Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL nextLink to get the next set of results. + + :param value: List of P2SVpnGateways. + :type value: list[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[P2SVpnGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListP2SVpnGatewaysResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVirtualHubBgpConnectionResults(msrest.serialization.Model): + """VirtualHubBgpConnections list. + + :param value: The list of VirtualHubBgpConnections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BgpConnection] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVirtualHubBgpConnectionResults, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVirtualHubIpConfigurationResults(msrest.serialization.Model): + """VirtualHubIpConfigurations list. + + :param value: The list of VirtualHubIpConfigurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HubIpConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVirtualHubIpConfigurationResults, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVirtualHubRouteTableV2SResult(msrest.serialization.Model): + """List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + + :param value: List of VirtualHubRouteTableV2s. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualHubRouteTableV2]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVirtualHubRouteTableV2SResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVirtualHubsResult(msrest.serialization.Model): + """Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set of results. + + :param value: List of VirtualHubs. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualHub] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualHub]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVirtualHubsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVirtualWANsResult(msrest.serialization.Model): + """Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink to get the next set of results. + + :param value: List of VirtualWANs. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualWAN] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualWAN]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVirtualWANsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVpnConnectionsResult(msrest.serialization.Model): + """Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections and a URL nextLink to get the next set of results. + + :param value: List of Vpn Connections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnConnection] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVpnConnectionsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVpnGatewaysResult(msrest.serialization.Model): + """Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set of results. + + :param value: List of VpnGateways. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVpnGatewaysResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVpnServerConfigurationsResult(msrest.serialization.Model): + """Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations and a URL nextLink to get the next set of results. + + :param value: List of VpnServerConfigurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnServerConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVpnServerConfigurationsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVpnSiteLinkConnectionsResult(msrest.serialization.Model): + """Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections and a URL nextLink to get the next set of results. + + :param value: List of VpnSiteLinkConnections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLinkConnection] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnSiteLinkConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVpnSiteLinkConnectionsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVpnSiteLinksResult(msrest.serialization.Model): + """Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink to get the next set of results. + + :param value: List of VpnSitesLinks. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLink] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnSiteLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVpnSiteLinksResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ListVpnSitesResult(msrest.serialization.Model): + """Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the next set of results. + + :param value: List of VpnSites. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnSite] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListVpnSitesResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the load balancer. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.LoadBalancerSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param frontend_ip_configurations: Object representing the frontend IPs to be used for the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by a load balancer. + :type backend_address_pools: list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load balancing rules Gets the + provisioning. + :type load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer. + :type probes: list[~azure.mgmt.network.v2020_07_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load balancer. Defining + inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT + pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are + associated with individual virtual machines cannot reference an Inbound NAT pool. They have to + reference individual inbound NAT rules. + :type inbound_nat_rules: list[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT to a single backend + port on NICs associated with a load balancer. Inbound NAT rules are created automatically for + each NIC associated with the Load Balancer using an external port from this range. Defining an + Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. + Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an inbound NAT pool. They have to reference + individual inbound NAT rules. + :type inbound_nat_pools: list[~azure.mgmt.network.v2020_07_01.models.InboundNatPool] + :param outbound_rules: The outbound rules. + :type outbound_rules: list[~azure.mgmt.network.v2020_07_01.models.OutboundRule] + :ivar resource_guid: The resource GUID property of the load balancer resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the load balancer resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_rules': {'key': 'properties.outboundRules', 'type': '[OutboundRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancer, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.sku = kwargs.get('sku', None) + self.etag = None + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_rules = kwargs.get('outbound_rules', None) + self.resource_guid = None + self.provisioning_state = None + + +class LoadBalancerBackendAddress(msrest.serialization.Model): + """Load balancer backend addresses. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of the backend address. + :type name: str + :param virtual_network: Reference to an existing virtual network. + :type virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param ip_address: IP Address belonging to the referenced virtual network. + :type ip_address: str + :ivar network_interface_ip_configuration: Reference to IP address defined in network + interfaces. + :vartype network_interface_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param load_balancer_frontend_ip_configuration: Reference to the frontend ip address + configuration defined in regional loadbalancer. + :type load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _validation = { + 'network_interface_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'network_interface_ip_configuration': {'key': 'properties.networkInterfaceIPConfiguration', 'type': 'SubResource'}, + 'load_balancer_frontend_ip_configuration': {'key': 'properties.loadBalancerFrontendIPConfiguration', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerBackendAddress, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.virtual_network = kwargs.get('virtual_network', None) + self.ip_address = kwargs.get('ip_address', None) + self.network_interface_ip_configuration = None + self.load_balancer_frontend_ip_configuration = kwargs.get('load_balancer_frontend_ip_configuration', None) + + +class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): + """Response for ListBackendAddressPool API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of backend address pools in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackendAddressPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerBackendAddressPoolListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LoadBalancerFrontendIPConfigurationListResult(msrest.serialization.Model): + """Response for ListFrontendIPConfiguration API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of frontend IP configurations in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FrontendIPConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerFrontendIPConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LoadBalancerListResult(msrest.serialization.Model): + """Response for ListLoadBalancers API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of load balancers in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancer] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LoadBalancerLoadBalancingRuleListResult(msrest.serialization.Model): + """Response for ListLoadBalancingRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of load balancing rules in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancingRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancingRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerLoadBalancingRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LoadBalancerOutboundRuleListResult(msrest.serialization.Model): + """Response for ListOutboundRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of outbound rules in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.OutboundRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerOutboundRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LoadBalancerProbeListResult(msrest.serialization.Model): + """Response for ListProbe API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of probes in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Probe] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Probe]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerProbeListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LoadBalancerSku(msrest.serialization.Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: "Basic", "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.LoadBalancerSkuName + :param tier: Tier of a load balancer SKU. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.LoadBalancerSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of load balancing rules + used by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound traffic is randomly load + balanced across IPs in the backend IPs. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param probe: The reference to the load balancer probe used by the load balancing rule. + :type probe: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protocol: The reference to the transport protocol used by the load balancing rule. + Possible values include: "Udp", "Tcp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. Possible values include: + "Default", "SourceIP", "SourceIPProtocol". + :type load_distribution: str or ~azure.mgmt.network.v2020_07_01.models.LoadDistribution + :param frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 + enables "Any Port". + :type frontend_port: int + :param backend_port: The port used for internal connections on the endpoint. Acceptable values + are between 0 and 65535. Note that value 0 enables "Any Port". + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :type enable_floating_ip: bool + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend pool to use the + publicIP address specified in the frontend of the load balancing rule. + :type disable_outbound_snat: bool + :ivar provisioning_state: The provisioning state of the load balancing rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancingRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) + self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) + self.provisioning_state = None + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param local_network_address_space: Local network site address space. + :type local_network_address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param fqdn: FQDN of local network gateway. + :type fqdn: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :ivar resource_guid: The resource GUID property of the local network gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the local network gateway resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.etag = None + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.fqdn = kwargs.get('fqdn', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = None + self.provisioning_state = None + + +class LocalNetworkGatewayListResult(msrest.serialization.Model): + """Response for ListLocalNetworkGateways API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of local network gateways that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LocalNetworkGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocalNetworkGatewayListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class LogSpecification(msrest.serialization.Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class ManagedRuleGroupOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The managed rule group to override. + :type rule_group_name: str + :param rules: List of rules that will be disabled. If none specified, all rules in the group + will be disabled. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.ManagedRuleOverride] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleGroupOverride, self).__init__(**kwargs) + self.rule_group_name = kwargs['rule_group_name'] + self.rules = kwargs.get('rules', None) + + +class ManagedRuleOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :param state: The state of the managed rule. Defaults to Disabled if not specified. Possible + values include: "Disabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ManagedRuleEnabledState + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = kwargs['rule_id'] + self.state = kwargs.get('state', None) + + +class ManagedRulesDefinition(msrest.serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to Azure. + + :param exclusions: The Exclusions that are applied on the policy. + :type exclusions: list[~azure.mgmt.network.v2020_07_01.models.OwaspCrsExclusionEntry] + :param managed_rule_sets: Required. The managed rule sets that are associated with the policy. + :type managed_rule_sets: list[~azure.mgmt.network.v2020_07_01.models.ManagedRuleSet] + """ + + _validation = { + 'managed_rule_sets': {'required': True}, + } + + _attribute_map = { + 'exclusions': {'key': 'exclusions', 'type': '[OwaspCrsExclusionEntry]'}, + 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRulesDefinition, self).__init__(**kwargs) + self.exclusions = kwargs.get('exclusions', None) + self.managed_rule_sets = kwargs['managed_rule_sets'] + + +class ManagedRuleSet(msrest.serialization.Model): + """Defines a managed rule set. + + All required parameters must be populated in order to send to Azure. + + :param rule_set_type: Required. Defines the rule set type to use. + :type rule_set_type: str + :param rule_set_version: Required. Defines the version of the rule set to use. + :type rule_set_version: str + :param rule_group_overrides: Defines the rule group overrides to apply to the rule set. + :type rule_group_overrides: + list[~azure.mgmt.network.v2020_07_01.models.ManagedRuleGroupOverride] + """ + + _validation = { + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedRuleSet, self).__init__(**kwargs) + self.rule_set_type = kwargs['rule_set_type'] + self.rule_set_version = kwargs['rule_set_version'] + self.rule_group_overrides = kwargs.get('rule_group_overrides', None) + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity. This property will only + be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the resource. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the virtual machine. Possible + values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.network.v2020_07_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class MatchCondition(msrest.serialization.Model): + """Define match conditions. + + All required parameters must be populated in order to send to Azure. + + :param match_variables: Required. List of match variables. + :type match_variables: list[~azure.mgmt.network.v2020_07_01.models.MatchVariable] + :param operator: Required. The operator to be matched. Possible values include: "IPMatch", + "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", "GreaterThanOrEqual", + "BeginsWith", "EndsWith", "Regex", "GeoMatch". + :type operator: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallOperator + :param negation_conditon: Whether this is negate condition or not. + :type negation_conditon: bool + :param match_values: Required. Match value. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or + ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallTransform] + """ + + _validation = { + 'match_variables': {'required': True}, + 'operator': {'required': True}, + 'match_values': {'required': True}, + } + + _attribute_map = { + 'match_variables': {'key': 'matchVariables', 'type': '[MatchVariable]'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negation_conditon': {'key': 'negationConditon', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MatchCondition, self).__init__(**kwargs) + self.match_variables = kwargs['match_variables'] + self.operator = kwargs['operator'] + self.negation_conditon = kwargs.get('negation_conditon', None) + self.match_values = kwargs['match_values'] + self.transforms = kwargs.get('transforms', None) + + +class MatchedRule(msrest.serialization.Model): + """Matched rule. + + :param rule_name: Name of the matched network security rule. + :type rule_name: str + :param action: The network traffic is allowed or denied. Possible values are 'Allow' and + 'Deny'. + :type action: str + """ + + _attribute_map = { + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MatchedRule, self).__init__(**kwargs) + self.rule_name = kwargs.get('rule_name', None) + self.action = kwargs.get('action', None) + + +class MatchVariable(msrest.serialization.Model): + """Define match variables. + + All required parameters must be populated in order to send to Azure. + + :param variable_name: Required. Match Variable. Possible values include: "RemoteAddr", + "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeaders", "RequestBody", + "RequestCookies". + :type variable_name: str or + ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallMatchVariable + :param selector: The selector of match variable. + :type selector: str + """ + + _validation = { + 'variable_name': {'required': True}, + } + + _attribute_map = { + 'variable_name': {'key': 'variableName', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MatchVariable, self).__init__(**kwargs) + self.variable_name = kwargs['variable_name'] + self.selector = kwargs.get('selector', None) + + +class MetricSpecification(msrest.serialization.Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: list[~azure.mgmt.network.v2020_07_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2020_07_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.availabilities = kwargs.get('availabilities', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.dimensions = kwargs.get('dimensions', None) + self.is_internal = kwargs.get('is_internal', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NatGateway(Resource): + """Nat Gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The nat gateway SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.NatGatewaySku + :param zones: A list of availability zones denoting the zone in which Nat Gateway should be + deployed. + :type zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param idle_timeout_in_minutes: The idle timeout of the nat gateway. + :type idle_timeout_in_minutes: int + :param public_ip_addresses: An array of public ip addresses associated with the nat gateway + resource. + :type public_ip_addresses: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param public_ip_prefixes: An array of public ip prefixes associated with the nat gateway + resource. + :type public_ip_prefixes: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar resource_guid: The resource GUID property of the NAT gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the NAT gateway resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnets': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'NatGatewaySku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'public_ip_addresses': {'key': 'properties.publicIpAddresses', 'type': '[SubResource]'}, + 'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[SubResource]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NatGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.zones = kwargs.get('zones', None) + self.etag = None + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.public_ip_addresses = kwargs.get('public_ip_addresses', None) + self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) + self.subnets = None + self.resource_guid = None + self.provisioning_state = None + + +class NatGatewayListResult(msrest.serialization.Model): + """Response for ListNatGateways API service call. + + :param value: A list of Nat Gateways that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NatGateway] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NatGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NatGatewayListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NatGatewaySku(msrest.serialization.Model): + """SKU of nat gateway. + + :param name: Name of Nat Gateway SKU. Possible values include: "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.NatGatewaySkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NatGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class NatRule(FirewallPolicyRule): + """Rule of type nat. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleNetworkProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or Service Tags. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param translated_address: The translated address for this NAT rule. + :type translated_address: str + :param translated_port: The translated port for this NAT rule. + :type translated_port: str + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param translated_fqdn: The translated FQDN for this NAT rule. + :type translated_fqdn: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'ip_protocols': {'key': 'ipProtocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'translated_address': {'key': 'translatedAddress', 'type': 'str'}, + 'translated_port': {'key': 'translatedPort', 'type': 'str'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'translated_fqdn': {'key': 'translatedFqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NatRule, self).__init__(**kwargs) + self.rule_type = 'NatRule' # type: str + self.ip_protocols = kwargs.get('ip_protocols', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.destination_ports = kwargs.get('destination_ports', None) + self.translated_address = kwargs.get('translated_address', None) + self.translated_port = kwargs.get('translated_port', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + self.translated_fqdn = kwargs.get('translated_fqdn', None) + + +class NetworkConfigurationDiagnosticParameters(msrest.serialization.Model): + """Parameters to get network configuration diagnostic. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to perform network + configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and + Application Gateway. + :type target_resource_id: str + :param verbosity_level: Verbosity level. Possible values include: "Normal", "Minimum", "Full". + :type verbosity_level: str or ~azure.mgmt.network.v2020_07_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic profiles. + :type profiles: + list[~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticProfile] + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'profiles': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'verbosity_level': {'key': 'verbosityLevel', 'type': 'str'}, + 'profiles': {'key': 'profiles', 'type': '[NetworkConfigurationDiagnosticProfile]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkConfigurationDiagnosticParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.verbosity_level = kwargs.get('verbosity_level', None) + self.profiles = kwargs['profiles'] + + +class NetworkConfigurationDiagnosticProfile(msrest.serialization.Model): + """Parameters to compare with network configuration. + + All required parameters must be populated in order to send to Azure. + + :param direction: Required. The direction of the traffic. Possible values include: "Inbound", + "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.Direction + :param protocol: Required. Protocol to be verified on. Accepted values are '*', TCP, UDP. + :type protocol: str + :param source: Required. Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + :type source: str + :param destination: Required. Traffic destination. Accepted values are: '*', IP Address/CIDR, + Service Tag. + :type destination: str + :param destination_port: Required. Traffic destination port. Accepted values are '*' and a + single port in the range (0 - 65535). + :type destination_port: str + """ + + _validation = { + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + 'destination_port': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'destination_port': {'key': 'destinationPort', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkConfigurationDiagnosticProfile, self).__init__(**kwargs) + self.direction = kwargs['direction'] + self.protocol = kwargs['protocol'] + self.source = kwargs['source'] + self.destination = kwargs['destination'] + self.destination_port = kwargs['destination_port'] + + +class NetworkConfigurationDiagnosticResponse(msrest.serialization.Model): + """Results of network configuration diagnostic on the target resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: List of network configuration diagnostic results. + :vartype results: + list[~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticResult] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[NetworkConfigurationDiagnosticResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkConfigurationDiagnosticResponse, self).__init__(**kwargs) + self.results = None + + +class NetworkConfigurationDiagnosticResult(msrest.serialization.Model): + """Network configuration diagnostic result corresponded to provided traffic query. + + :param profile: Network configuration diagnostic profile. + :type profile: ~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticProfile + :param network_security_group_result: Network security group result. + :type network_security_group_result: + ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroupResult + """ + + _attribute_map = { + 'profile': {'key': 'profile', 'type': 'NetworkConfigurationDiagnosticProfile'}, + 'network_security_group_result': {'key': 'networkSecurityGroupResult', 'type': 'NetworkSecurityGroupResult'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkConfigurationDiagnosticResult, self).__init__(**kwargs) + self.profile = kwargs.get('profile', None) + self.network_security_group_result = kwargs.get('network_security_group_result', None) + + +class NetworkIntentPolicy(Resource): + """Network Intent Policy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkIntentPolicy, self).__init__(**kwargs) + self.etag = None + + +class NetworkIntentPolicyConfiguration(msrest.serialization.Model): + """Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. + + :param network_intent_policy_name: The name of the Network Intent Policy for storing in target + subscription. + :type network_intent_policy_name: str + :param source_network_intent_policy: Source network intent policy. + :type source_network_intent_policy: ~azure.mgmt.network.v2020_07_01.models.NetworkIntentPolicy + """ + + _attribute_map = { + 'network_intent_policy_name': {'key': 'networkIntentPolicyName', 'type': 'str'}, + 'source_network_intent_policy': {'key': 'sourceNetworkIntentPolicy', 'type': 'NetworkIntentPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkIntentPolicyConfiguration, self).__init__(**kwargs) + self.network_intent_policy_name = kwargs.get('network_intent_policy_name', None) + self.source_network_intent_policy = kwargs.get('source_network_intent_policy', None) + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the network interface. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_machine: The reference to a virtual machine. + :vartype virtual_machine: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :ivar private_endpoint: A reference to the private endpoint to which the network interface is + linked. + :vartype private_endpoint: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :param ip_configurations: A list of IPConfigurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceDnsSettings + :ivar mac_address: The MAC address of the network interface. + :vartype mac_address: str + :ivar primary: Whether this is a primary network interface on a virtual machine. + :vartype primary: bool + :param enable_accelerated_networking: If the network interface is accelerated networking + enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on this network + interface. + :type enable_ip_forwarding: bool + :ivar hosted_workloads: A list of references to linked BareMetal resources. + :vartype hosted_workloads: list[str] + :ivar dscp_configuration: A reference to the dscp configuration to which the network interface + is linked. + :vartype dscp_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar resource_guid: The resource GUID property of the network interface resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network interface resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_machine': {'readonly': True}, + 'private_endpoint': {'readonly': True}, + 'tap_configurations': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'primary': {'readonly': True}, + 'hosted_workloads': {'readonly': True}, + 'dscp_configuration': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'tap_configurations': {'key': 'properties.tapConfigurations', 'type': '[NetworkInterfaceTapConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'hosted_workloads': {'key': 'properties.hostedWorkloads', 'type': '[str]'}, + 'dscp_configuration': {'key': 'properties.dscpConfiguration', 'type': 'SubResource'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterface, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.etag = None + self.virtual_machine = None + self.network_security_group = kwargs.get('network_security_group', None) + self.private_endpoint = None + self.ip_configurations = kwargs.get('ip_configurations', None) + self.tap_configurations = None + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = None + self.primary = None + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.hosted_workloads = None + self.dscp_configuration = None + self.resource_guid = None + self.provisioning_state = None + + +class NetworkInterfaceAssociation(msrest.serialization.Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = kwargs.get('security_rules', None) + + +class NetworkInterfaceDnsSettings(msrest.serialization.Model): + """DNS settings of a network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param dns_servers: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure + provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be + the only value in dnsServers collection. + :type dns_servers: list[str] + :ivar applied_dns_servers: If the VM that uses this NIC is part of an Availability Set, then + this list will have the union of all DNS servers from all NICs that are part of the + Availability Set. This property is what is configured on each of those VMs. + :vartype applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for internal communications + between VMs in the same virtual network. + :type internal_dns_name_label: str + :ivar internal_fqdn: Fully qualified DNS name supporting internal communications between VMs in + the same virtual network. + :vartype internal_fqdn: str + :ivar internal_domain_name_suffix: Even if internalDnsNameLabel is not specified, a DNS entry + is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the + VM name with the value of internalDomainNameSuffix. + :vartype internal_domain_name_suffix: str + """ + + _validation = { + 'applied_dns_servers': {'readonly': True}, + 'internal_fqdn': {'readonly': True}, + 'internal_domain_name_suffix': {'readonly': True}, + } + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = None + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = None + self.internal_domain_name_suffix = None + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_network_taps: The reference to Virtual Network Taps. + :type virtual_network_taps: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap] + :param application_gateway_backend_address_pools: The reference to + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference to LoadBalancerBackendAddressPool + resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param primary: Whether this is a primary customer address on the network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which the IP configuration + is included. + :type application_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :ivar provisioning_state: The provisioning state of the network interface IP configuration. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_link_connection_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_network_taps': {'key': 'properties.virtualNetworkTaps', 'type': '[VirtualNetworkTap]'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_link_connection_properties': {'key': 'properties.privateLinkConnectionProperties', 'type': 'NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.virtual_network_taps = kwargs.get('virtual_network_taps', None) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.provisioning_state = None + self.private_link_connection_properties = None + + +class NetworkInterfaceIPConfigurationListResult(msrest.serialization.Model): + """Response for list ip configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of ip configurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceIPConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(msrest.serialization.Model): + """PrivateLinkConnection properties for the network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: The group ID for current private link connection. + :vartype group_id: str + :ivar required_member_name: The required member name for current private link connection. + :vartype required_member_name: str + :ivar fqdns: List of FQDNs for current private link connection. + :vartype fqdns: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_member_name': {'readonly': True}, + 'fqdns': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_member_name': {'key': 'requiredMemberName', 'type': 'str'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties, self).__init__(**kwargs) + self.group_id = None + self.required_member_name = None + self.fqdns = None + + +class NetworkInterfaceListResult(msrest.serialization.Model): + """Response for the ListNetworkInterface API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of network interfaces in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkInterface]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkInterfaceLoadBalancerListResult(msrest.serialization.Model): + """Response for list ip configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of load balancers. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancer] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceLoadBalancerListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkInterfaceTapConfiguration(SubResource): + """Tap configuration in a Network Interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Sub Resource type. + :vartype type: str + :param virtual_network_tap: The reference to the Virtual Network Tap resource. + :type virtual_network_tap: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :ivar provisioning_state: The provisioning state of the network interface tap configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_tap': {'key': 'properties.virtualNetworkTap', 'type': 'VirtualNetworkTap'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceTapConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.virtual_network_tap = kwargs.get('virtual_network_tap', None) + self.provisioning_state = None + + +class NetworkInterfaceTapConfigurationListResult(msrest.serialization.Model): + """Response for list tap configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of tap configurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkInterfaceTapConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceTapConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkProfile(Resource): + """Network profile resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar container_network_interfaces: List of child container network interfaces. + :vartype container_network_interfaces: + list[~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterface] + :param container_network_interface_configurations: List of chid container network interface + configurations. + :type container_network_interface_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterfaceConfiguration] + :ivar resource_guid: The resource GUID property of the network profile resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network profile resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'container_network_interfaces': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'container_network_interfaces': {'key': 'properties.containerNetworkInterfaces', 'type': '[ContainerNetworkInterface]'}, + 'container_network_interface_configurations': {'key': 'properties.containerNetworkInterfaceConfigurations', 'type': '[ContainerNetworkInterfaceConfiguration]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.etag = None + self.container_network_interfaces = None + self.container_network_interface_configurations = kwargs.get('container_network_interface_configurations', None) + self.resource_guid = None + self.provisioning_state = None + + +class NetworkProfileListResult(msrest.serialization.Model): + """Response for ListNetworkProfiles API service call. + + :param value: A list of network profiles that exist in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkProfile] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkProfileListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NetworkRule(FirewallPolicyRule): + """Rule of type network. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleNetworkProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or Service Tags. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param destination_ip_groups: List of destination IpGroups for this rule. + :type destination_ip_groups: list[str] + :param destination_fqdns: List of destination FQDNs. + :type destination_fqdns: list[str] + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'ip_protocols': {'key': 'ipProtocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'destination_ip_groups': {'key': 'destinationIpGroups', 'type': '[str]'}, + 'destination_fqdns': {'key': 'destinationFqdns', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkRule, self).__init__(**kwargs) + self.rule_type = 'NetworkRule' # type: str + self.ip_protocols = kwargs.get('ip_protocols', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.destination_ports = kwargs.get('destination_ports', None) + self.source_ip_groups = kwargs.get('source_ip_groups', None) + self.destination_ip_groups = kwargs.get('destination_ip_groups', None) + self.destination_fqdns = kwargs.get('destination_fqdns', None) + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param security_rules: A collection of security rules of the network security group. + :type security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2020_07_01.models.FlowLog] + :ivar resource_guid: The resource GUID property of the network security group resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network security group resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'default_security_rules': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + 'flow_logs': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'flow_logs': {'key': 'properties.flowLogs', 'type': '[FlowLog]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.etag = None + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = None + self.network_interfaces = None + self.subnets = None + self.flow_logs = None + self.resource_guid = None + self.provisioning_state = None + + +class NetworkSecurityGroupListResult(msrest.serialization.Model): + """Response for ListNetworkSecurityGroups API service call. + + :param value: A list of NetworkSecurityGroup resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NetworkSecurityGroupResult(msrest.serialization.Model): + """Network configuration diagnostic result corresponded provided traffic query. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param security_rule_access_result: The network traffic is allowed or denied. Possible values + include: "Allow", "Deny". + :type security_rule_access_result: str or + ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAccess + :ivar evaluated_network_security_groups: List of results network security groups diagnostic. + :vartype evaluated_network_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.EvaluatedNetworkSecurityGroup] + """ + + _validation = { + 'evaluated_network_security_groups': {'readonly': True}, + } + + _attribute_map = { + 'security_rule_access_result': {'key': 'securityRuleAccessResult', 'type': 'str'}, + 'evaluated_network_security_groups': {'key': 'evaluatedNetworkSecurityGroups', 'type': '[EvaluatedNetworkSecurityGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSecurityGroupResult, self).__init__(**kwargs) + self.security_rule_access_result = kwargs.get('security_rule_access_result', None) + self.evaluated_network_security_groups = None + + +class NetworkSecurityRulesEvaluationResult(msrest.serialization.Model): + """Network security rules evaluation result. + + :param name: Name of the network security rule. + :type name: str + :param protocol_matched: Value indicating whether protocol is matched. + :type protocol_matched: bool + :param source_matched: Value indicating whether source is matched. + :type source_matched: bool + :param source_port_matched: Value indicating whether source port is matched. + :type source_port_matched: bool + :param destination_matched: Value indicating whether destination is matched. + :type destination_matched: bool + :param destination_port_matched: Value indicating whether destination port is matched. + :type destination_port_matched: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol_matched': {'key': 'protocolMatched', 'type': 'bool'}, + 'source_matched': {'key': 'sourceMatched', 'type': 'bool'}, + 'source_port_matched': {'key': 'sourcePortMatched', 'type': 'bool'}, + 'destination_matched': {'key': 'destinationMatched', 'type': 'bool'}, + 'destination_port_matched': {'key': 'destinationPortMatched', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkSecurityRulesEvaluationResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol_matched = kwargs.get('protocol_matched', None) + self.source_matched = kwargs.get('source_matched', None) + self.source_port_matched = kwargs.get('source_port_matched', None) + self.destination_matched = kwargs.get('destination_matched', None) + self.destination_port_matched = kwargs.get('destination_port_matched', None) + + +class NetworkVirtualAppliance(Resource): + """NetworkVirtualAppliance Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param identity: The service principal that has read access to cloud-init and config blob. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param nva_sku: Network Virtual Appliance SKU. + :type nva_sku: ~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSkuProperties + :ivar address_prefix: Address Prefix. + :vartype address_prefix: str + :param boot_strap_configuration_blobs: BootStrapConfigurationBlobs storage URLs. + :type boot_strap_configuration_blobs: list[str] + :param virtual_hub: The Virtual Hub where Network Virtual Appliance is being deployed. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param cloud_init_configuration_blobs: CloudInitConfigurationBlob storage URLs. + :type cloud_init_configuration_blobs: list[str] + :param cloud_init_configuration: CloudInitConfiguration string in plain text. + :type cloud_init_configuration: str + :param virtual_appliance_asn: VirtualAppliance ASN. + :type virtual_appliance_asn: long + :ivar virtual_appliance_nics: List of Virtual Appliance Network Interfaces. + :vartype virtual_appliance_nics: + list[~azure.mgmt.network.v2020_07_01.models.VirtualApplianceNicProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar inbound_security_rules: List of references to InboundSecurityRules. + :vartype inbound_security_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'address_prefix': {'readonly': True}, + 'virtual_appliance_asn': {'maximum': 4294967295, 'minimum': 0}, + 'virtual_appliance_nics': {'readonly': True}, + 'virtual_appliance_sites': {'readonly': True}, + 'inbound_security_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'nva_sku': {'key': 'properties.nvaSku', 'type': 'VirtualApplianceSkuProperties'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'boot_strap_configuration_blobs': {'key': 'properties.bootStrapConfigurationBlobs', 'type': '[str]'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'cloud_init_configuration_blobs': {'key': 'properties.cloudInitConfigurationBlobs', 'type': '[str]'}, + 'cloud_init_configuration': {'key': 'properties.cloudInitConfiguration', 'type': 'str'}, + 'virtual_appliance_asn': {'key': 'properties.virtualApplianceAsn', 'type': 'long'}, + 'virtual_appliance_nics': {'key': 'properties.virtualApplianceNics', 'type': '[VirtualApplianceNicProperties]'}, + 'virtual_appliance_sites': {'key': 'properties.virtualApplianceSites', 'type': '[SubResource]'}, + 'inbound_security_rules': {'key': 'properties.inboundSecurityRules', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualAppliance, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.etag = None + self.nva_sku = kwargs.get('nva_sku', None) + self.address_prefix = None + self.boot_strap_configuration_blobs = kwargs.get('boot_strap_configuration_blobs', None) + self.virtual_hub = kwargs.get('virtual_hub', None) + self.cloud_init_configuration_blobs = kwargs.get('cloud_init_configuration_blobs', None) + self.cloud_init_configuration = kwargs.get('cloud_init_configuration', None) + self.virtual_appliance_asn = kwargs.get('virtual_appliance_asn', None) + self.virtual_appliance_nics = None + self.virtual_appliance_sites = None + self.inbound_security_rules = None + self.provisioning_state = None + + +class NetworkVirtualApplianceListResult(msrest.serialization.Model): + """Response for ListNetworkVirtualAppliances API service call. + + :param value: List of Network Virtual Appliances. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkVirtualAppliance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualApplianceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NetworkVirtualApplianceSiteListResult(msrest.serialization.Model): + """Response for ListNetworkVirtualApplianceSites API service call. + + :param value: List of Network Virtual Appliance sites. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualApplianceSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualApplianceSiteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NetworkVirtualApplianceSku(Resource): + """Definition of the NetworkVirtualApplianceSkus resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar vendor: Network Virtual Appliance Sku vendor. + :vartype vendor: str + :ivar available_versions: Available Network Virtual Appliance versions. + :vartype available_versions: list[str] + :param available_scale_units: The list of scale units available. + :type available_scale_units: + list[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSkuInstances] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'vendor': {'readonly': True}, + 'available_versions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'available_versions': {'key': 'properties.availableVersions', 'type': '[str]'}, + 'available_scale_units': {'key': 'properties.availableScaleUnits', 'type': '[NetworkVirtualApplianceSkuInstances]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualApplianceSku, self).__init__(**kwargs) + self.etag = None + self.vendor = None + self.available_versions = None + self.available_scale_units = kwargs.get('available_scale_units', None) + + +class NetworkVirtualApplianceSkuInstances(msrest.serialization.Model): + """List of available Sku and instances. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar scale_unit: Scale Unit. + :vartype scale_unit: str + :ivar instance_count: Instance Count. + :vartype instance_count: int + """ + + _validation = { + 'scale_unit': {'readonly': True}, + 'instance_count': {'readonly': True}, + } + + _attribute_map = { + 'scale_unit': {'key': 'scaleUnit', 'type': 'str'}, + 'instance_count': {'key': 'instanceCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualApplianceSkuInstances, self).__init__(**kwargs) + self.scale_unit = None + self.instance_count = None + + +class NetworkVirtualApplianceSkuListResult(msrest.serialization.Model): + """Response for ListNetworkVirtualApplianceSkus API service call. + + :param value: List of Network Virtual Appliance Skus that are available. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSku] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkVirtualApplianceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualApplianceSkuListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the network watcher resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = None + self.provisioning_state = None + + +class NetworkWatcherListResult(msrest.serialization.Model): + """Response for ListNetworkWatchers API service call. + + :param value: List of network watcher resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkWatcher] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkWatcher]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkWatcherListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class NextHopParameters(msrest.serialization.Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target resource against + which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is + enabled on any of the nics, then this parameter must be specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.source_ip_address = kwargs['source_ip_address'] + self.destination_ip_address = kwargs['destination_ip_address'] + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) + + +class NextHopResult(msrest.serialization.Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: "Internet", "VirtualAppliance", + "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", "None". + :type next_hop_type: str or ~azure.mgmt.network.v2020_07_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address. + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table associated with the route + being returned. If the route being returned does not correspond to any user created routes then + this field will be the string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) + + +class O365BreakOutCategoryPolicies(msrest.serialization.Model): + """Office365 breakout categories. + + :param allow: Flag to control allow category. + :type allow: bool + :param optimize: Flag to control optimize category. + :type optimize: bool + :param default: Flag to control default category. + :type default: bool + """ + + _attribute_map = { + 'allow': {'key': 'allow', 'type': 'bool'}, + 'optimize': {'key': 'optimize', 'type': 'bool'}, + 'default': {'key': 'default', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(O365BreakOutCategoryPolicies, self).__init__(**kwargs) + self.allow = kwargs.get('allow', None) + self.optimize = kwargs.get('optimize', None) + self.default = kwargs.get('default', None) + + +class O365PolicyProperties(msrest.serialization.Model): + """The Office365 breakout policy. + + :param break_out_categories: Office365 breakout categories. + :type break_out_categories: ~azure.mgmt.network.v2020_07_01.models.O365BreakOutCategoryPolicies + """ + + _attribute_map = { + 'break_out_categories': {'key': 'breakOutCategories', 'type': 'O365BreakOutCategoryPolicies'}, + } + + def __init__( + self, + **kwargs + ): + super(O365PolicyProperties, self).__init__(**kwargs) + self.break_out_categories = kwargs.get('break_out_categories', None) + + +class Office365PolicyProperties(msrest.serialization.Model): + """Network Virtual Appliance Sku Properties. + + :param break_out_categories: Office 365 breakout categories. + :type break_out_categories: ~azure.mgmt.network.v2020_07_01.models.BreakOutCategoryPolicies + """ + + _attribute_map = { + 'break_out_categories': {'key': 'breakOutCategories', 'type': 'BreakOutCategoryPolicies'}, + } + + def __init__( + self, + **kwargs + ): + super(Office365PolicyProperties, self).__init__(**kwargs) + self.break_out_categories = kwargs.get('break_out_categories', None) + + +class Operation(msrest.serialization.Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2020_07_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2020_07_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Network operations supported by the Network resource provider. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OperationPropertiesFormatServiceSpecification(msrest.serialization.Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: list[~azure.mgmt.network.v2020_07_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: list[~azure.mgmt.network.v2020_07_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) + + +class OutboundRule(SubResource): + """Outbound rule of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of outbound rules used by + the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param allocated_outbound_ports: The number of outbound ports to be used for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load balancer. + :type frontend_ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param backend_address_pool: A reference to a pool of DIPs. Outbound traffic is randomly load + balanced across IPs in the backend IPs. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the outbound rule resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param protocol: The protocol for the outbound rule in load balancer. Possible values include: + "Tcp", "Udp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.LoadBalancerOutboundRuleProtocol + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + :type idle_timeout_in_minutes: int + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = None + self.protocol = kwargs.get('protocol', None) + self.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + + +class OwaspCrsExclusionEntry(msrest.serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. The variable to be excluded. Possible values include: + "RequestHeaderNames", "RequestCookieNames", "RequestArgNames". + :type match_variable: str or + ~azure.mgmt.network.v2020_07_01.models.OwaspCrsExclusionEntryMatchVariable + :param selector_match_operator: Required. When matchVariable is a collection, operate on the + selector to specify which elements in the collection this exclusion applies to. Possible values + include: "Equals", "Contains", "StartsWith", "EndsWith", "EqualsAny". + :type selector_match_operator: str or + ~azure.mgmt.network.v2020_07_01.models.OwaspCrsExclusionEntrySelectorMatchOperator + :param selector: Required. When matchVariable is a collection, operator used to specify which + elements in the collection this exclusion applies to. + :type selector: str + """ + + _validation = { + 'match_variable': {'required': True}, + 'selector_match_operator': {'required': True}, + 'selector': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector_match_operator': {'key': 'selectorMatchOperator', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OwaspCrsExclusionEntry, self).__init__(**kwargs) + self.match_variable = kwargs['match_variable'] + self.selector_match_operator = kwargs['selector_match_operator'] + self.selector = kwargs['selector'] + + +class P2SConnectionConfiguration(SubResource): + """P2SConnectionConfiguration Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :type vpn_client_address_pool: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + :param enable_internet_security: Flag indicating whether the enable internet security flag is + turned on for the P2S Connections or not. + :type enable_internet_security: bool + :ivar provisioning_state: The provisioning state of the P2SConnectionConfiguration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'vpn_client_address_pool': {'key': 'properties.vpnClientAddressPool', 'type': 'AddressSpace'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(P2SConnectionConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.routing_configuration = kwargs.get('routing_configuration', None) + self.enable_internet_security = kwargs.get('enable_internet_security', None) + self.provisioning_state = None + + +class P2SVpnConnectionHealth(msrest.serialization.Model): + """P2S Vpn connection detailed health written to sas url. + + :param sas_url: Returned sas url of the blob to which the p2s vpn connection detailed health + will be written. + :type sas_url: str + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(P2SVpnConnectionHealth, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + + +class P2SVpnConnectionHealthRequest(msrest.serialization.Model): + """List of P2S Vpn connection health request. + + :param vpn_user_names_filter: The list of p2s vpn user names whose p2s vpn connection detailed + health to retrieve for. + :type vpn_user_names_filter: list[str] + :param output_blob_sas_url: The sas-url to download the P2S Vpn connection health detail. + :type output_blob_sas_url: str + """ + + _attribute_map = { + 'vpn_user_names_filter': {'key': 'vpnUserNamesFilter', 'type': '[str]'}, + 'output_blob_sas_url': {'key': 'outputBlobSasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(P2SVpnConnectionHealthRequest, self).__init__(**kwargs) + self.vpn_user_names_filter = kwargs.get('vpn_user_names_filter', None) + self.output_blob_sas_url = kwargs.get('output_blob_sas_url', None) + + +class P2SVpnConnectionRequest(msrest.serialization.Model): + """List of p2s vpn connections to be disconnected. + + :param vpn_connection_ids: List of p2s vpn connection Ids. + :type vpn_connection_ids: list[str] + """ + + _attribute_map = { + 'vpn_connection_ids': {'key': 'vpnConnectionIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(P2SVpnConnectionRequest, self).__init__(**kwargs) + self.vpn_connection_ids = kwargs.get('vpn_connection_ids', None) + + +class P2SVpnGateway(Resource): + """P2SVpnGateway Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_hub: The VirtualHub to which the gateway belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param p2_s_connection_configurations: List of all p2s connection configurations of the + gateway. + :type p2_s_connection_configurations: + list[~azure.mgmt.network.v2020_07_01.models.P2SConnectionConfiguration] + :ivar provisioning_state: The provisioning state of the P2S VPN gateway resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param vpn_gateway_scale_unit: The scale unit for this p2s vpn gateway. + :type vpn_gateway_scale_unit: int + :param vpn_server_configuration: The VpnServerConfiguration to which the p2sVpnGateway is + attached to. + :type vpn_server_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2020_07_01.models.VpnClientConnectionHealth + :param custom_dns_servers: List of all customer specified DNS servers IP addresses. + :type custom_dns_servers: list[str] + :param is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the P2SVpnGateway. + :type is_routing_preference_internet: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'vpn_client_connection_health': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'p2_s_connection_configurations': {'key': 'properties.p2SConnectionConfigurations', 'type': '[P2SConnectionConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vpn_gateway_scale_unit': {'key': 'properties.vpnGatewayScaleUnit', 'type': 'int'}, + 'vpn_server_configuration': {'key': 'properties.vpnServerConfiguration', 'type': 'SubResource'}, + 'vpn_client_connection_health': {'key': 'properties.vpnClientConnectionHealth', 'type': 'VpnClientConnectionHealth'}, + 'custom_dns_servers': {'key': 'properties.customDnsServers', 'type': '[str]'}, + 'is_routing_preference_internet': {'key': 'properties.isRoutingPreferenceInternet', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(P2SVpnGateway, self).__init__(**kwargs) + self.etag = None + self.virtual_hub = kwargs.get('virtual_hub', None) + self.p2_s_connection_configurations = kwargs.get('p2_s_connection_configurations', None) + self.provisioning_state = None + self.vpn_gateway_scale_unit = kwargs.get('vpn_gateway_scale_unit', None) + self.vpn_server_configuration = kwargs.get('vpn_server_configuration', None) + self.vpn_client_connection_health = None + self.custom_dns_servers = kwargs.get('custom_dns_servers', None) + self.is_routing_preference_internet = kwargs.get('is_routing_preference_internet', None) + + +class P2SVpnProfileParameters(msrest.serialization.Model): + """Vpn Client Parameters for package generation. + + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_07_01.models.AuthenticationMethod + """ + + _attribute_map = { + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(P2SVpnProfileParameters, self).__init__(**kwargs) + self.authentication_method = kwargs.get('authentication_method', None) + + +class PacketCapture(msrest.serialization.Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: Required. The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs['target'] + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs['storage_location'] + self.filters = kwargs.get('filters', None) + + +class PacketCaptureFilter(msrest.serialization.Model): + """Filter that is applied to packet capture request. Multiple filters can be applied. + + :param protocol: Protocol to be filtered on. Possible values include: "TCP", "UDP", "Any". + Default value: "Any". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + + +class PacketCaptureListResult(msrest.serialization.Model): + """List of packet capture sessions. + + :param value: Information about packet capture sessions. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PacketCaptureResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PacketCaptureParameters(msrest.serialization.Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: Required. The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs['target'] + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs['storage_location'] + self.filters = kwargs.get('filters', None) + + +class PacketCaptureQueryStatusResult(msrest.serialization.Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: ~datetime.datetime + :param packet_capture_status: The status of the packet capture session. Possible values + include: "NotStarted", "Running", "Stopped", "Error", "Unknown". + :type packet_capture_status: str or ~azure.mgmt.network.v2020_07_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or ~azure.mgmt.network.v2020_07_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) + + +class PacketCaptureResult(msrest.serialization.Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param target: The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + :ivar provisioning_state: The provisioning state of the packet capture session. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = None + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = None + + +class PacketCaptureResultProperties(PacketCaptureParameters): + """The properties of a packet capture session. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: Required. The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + :ivar provisioning_state: The provisioning state of the packet capture session. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'target': {'required': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'storage_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureResultProperties, self).__init__(**kwargs) + self.provisioning_state = None + + +class PacketCaptureStorageLocation(msrest.serialization.Model): + """The storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet capture session. Required + if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet capture. Must be a well- + formed URI describing the location to save the packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the name of the capture + file (*.cap). For linux virtual machine it must start with /var/captures. Required if no + storage ID is provided, otherwise optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route filter. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the route filter resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peerings': {'readonly': True}, + 'ipv6_peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'ipv6_peerings': {'key': 'properties.ipv6Peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchRouteFilter, self).__init__(**kwargs) + self.name = None + self.etag = None + self.type = None + self.tags = kwargs.get('tags', None) + self.rules = kwargs.get('rules', None) + self.peerings = None + self.ipv6_peerings = None + self.provisioning_state = None + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param access: The access type of the rule. Possible values include: "Allow", "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.Access + :param route_filter_rule_type: The rule type of the rule. Possible values include: "Community". + :type route_filter_rule_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteFilterRuleType + :param communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the route filter rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.name = None + self.etag = None + self.access = kwargs.get('access', None) + self.route_filter_rule_type = kwargs.get('route_filter_rule_type', None) + self.communities = kwargs.get('communities', None) + self.provisioning_state = None + + +class PeerExpressRouteCircuitConnection(SubResource): + """Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit. + :type express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :type peer_express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :type address_prefix: str + :ivar circuit_connection_status: Express Route Circuit connection state. Possible values + include: "Connected", "Connecting", "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.CircuitConnectionStatus + :param connection_name: The name of the express route circuit connection resource. + :type connection_name: str + :param auth_resource_guid: The resource guid of the authorization used for the express route + circuit connection. + :type auth_resource_guid: str + :ivar provisioning_state: The provisioning state of the peer express route circuit connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'express_route_circuit_peering': {'key': 'properties.expressRouteCircuitPeering', 'type': 'SubResource'}, + 'peer_express_route_circuit_peering': {'key': 'properties.peerExpressRouteCircuitPeering', 'type': 'SubResource'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'connection_name': {'key': 'properties.connectionName', 'type': 'str'}, + 'auth_resource_guid': {'key': 'properties.authResourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeerExpressRouteCircuitConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.express_route_circuit_peering = kwargs.get('express_route_circuit_peering', None) + self.peer_express_route_circuit_peering = kwargs.get('peer_express_route_circuit_peering', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.circuit_connection_status = None + self.connection_name = kwargs.get('connection_name', None) + self.auth_resource_guid = kwargs.get('auth_resource_guid', None) + self.provisioning_state = None + + +class PeerExpressRouteCircuitConnectionListResult(msrest.serialization.Model): + """Response for ListPeeredConnections API service call retrieves all global reach peer circuit connections that belongs to a Private Peering for an ExpressRouteCircuit. + + :param value: The global reach peer circuit connection associated with Private Peering in an + ExpressRoute Circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnection] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PeerExpressRouteCircuitConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PeerExpressRouteCircuitConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PeerRoute(msrest.serialization.Model): + """Peer routing details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The peer's local address. + :vartype local_address: str + :ivar network: The route's network prefix. + :vartype network: str + :ivar next_hop: The route's next hop. + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from. + :vartype source_peer: str + :ivar origin: The source this route was learned from. + :vartype origin: str + :ivar as_path: The route's AS path sequence. + :vartype as_path: str + :ivar weight: The route's weight. + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PeerRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None + + +class PeerRouteList(msrest.serialization.Model): + """List of virtual router peer routes. + + :param value: List of peer routes. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PeerRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PeerRoute]'}, + } + + def __init__( + self, + **kwargs + ): + super(PeerRouteList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PolicySettings(msrest.serialization.Model): + """Defines contents of a web application firewall global configuration. + + :param state: The state of the policy. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallEnabledState + :param mode: The mode of the policy. Possible values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallMode + :param request_body_check: Whether to allow WAF to check request Body. + :type request_body_check: bool + :param max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :type max_request_body_size_in_kb: int + :param file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :type file_upload_limit_in_mb: int + """ + + _validation = { + 'max_request_body_size_in_kb': {'maximum': 128, 'minimum': 8}, + 'file_upload_limit_in_mb': {'minimum': 0}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'bool'}, + 'max_request_body_size_in_kb': {'key': 'maxRequestBodySizeInKb', 'type': 'int'}, + 'file_upload_limit_in_mb': {'key': 'fileUploadLimitInMb', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PolicySettings, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.mode = kwargs.get('mode', None) + self.request_body_check = kwargs.get('request_body_check', None) + self.max_request_body_size_in_kb = kwargs.get('max_request_body_size_in_kb', None) + self.file_upload_limit_in_mb = kwargs.get('file_upload_limit_in_mb', None) + + +class PrepareNetworkPoliciesRequest(msrest.serialization.Model): + """Details of PrepareNetworkPolicies for Subnet. + + :param service_name: The name of the service for which subnet is being prepared for. + :type service_name: str + :param network_intent_policy_configurations: A list of NetworkIntentPolicyConfiguration. + :type network_intent_policy_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkIntentPolicyConfiguration] + """ + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'network_intent_policy_configurations': {'key': 'networkIntentPolicyConfigurations', 'type': '[NetworkIntentPolicyConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrepareNetworkPoliciesRequest, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.network_intent_policy_configurations = kwargs.get('network_intent_policy_configurations', None) + + +class PrivateDnsZoneConfig(msrest.serialization.Model): + """PrivateDnsZoneConfig resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :param private_dns_zone_id: The resource id of the private dns zone. + :type private_dns_zone_id: str + :ivar record_sets: A collection of information regarding a recordSet, holding information to + identify private resources. + :vartype record_sets: list[~azure.mgmt.network.v2020_07_01.models.RecordSet] + """ + + _validation = { + 'record_sets': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_dns_zone_id': {'key': 'properties.privateDnsZoneId', 'type': 'str'}, + 'record_sets': {'key': 'properties.recordSets', 'type': '[RecordSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateDnsZoneConfig, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.private_dns_zone_id = kwargs.get('private_dns_zone_id', None) + self.record_sets = None + + +class PrivateDnsZoneGroup(SubResource): + """Private dns zone group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private dns zone group resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_dns_zone_configs: A collection of private dns zone configurations of the private + dns zone group. + :type private_dns_zone_configs: + list[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneConfig] + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_dns_zone_configs': {'key': 'properties.privateDnsZoneConfigs', 'type': '[PrivateDnsZoneConfig]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateDnsZoneGroup, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.provisioning_state = None + self.private_dns_zone_configs = kwargs.get('private_dns_zone_configs', None) + + +class PrivateDnsZoneGroupListResult(msrest.serialization.Model): + """Response for the ListPrivateDnsZoneGroups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of private dns zone group resources in a private endpoint. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateDnsZoneGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateDnsZoneGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class PrivateEndpoint(Resource): + """Private endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param subnet: The ID of the subnet from which the private IP will be allocated. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :ivar network_interfaces: An array of references to the network interfaces created for this + private endpoint. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar provisioning_state: The provisioning state of the private endpoint resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_link_service_connections: A grouping of information about the connection to the + remote resource. + :type private_link_service_connections: + list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnection] + :param manual_private_link_service_connections: A grouping of information about the connection + to the remote resource. Used when the network admin does not have access to approve connections + to the remote resource. + :type manual_private_link_service_connections: + list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnection] + :param custom_dns_configs: An array of custom dns configurations. + :type custom_dns_configs: + list[~azure.mgmt.network.v2020_07_01.models.CustomDnsConfigPropertiesFormat] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_link_service_connections': {'key': 'properties.privateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'manual_private_link_service_connections': {'key': 'properties.manualPrivateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'custom_dns_configs': {'key': 'properties.customDnsConfigs', 'type': '[CustomDnsConfigPropertiesFormat]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.etag = None + self.subnet = kwargs.get('subnet', None) + self.network_interfaces = None + self.provisioning_state = None + self.private_link_service_connections = kwargs.get('private_link_service_connections', None) + self.manual_private_link_service_connections = kwargs.get('manual_private_link_service_connections', None) + self.custom_dns_configs = kwargs.get('custom_dns_configs', None) + + +class PrivateEndpointConnection(SubResource): + """PrivateEndpointConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar link_identifier: The consumer link id. + :vartype link_identifier: str + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'private_endpoint': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'link_identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'link_identifier': {'key': 'properties.linkIdentifier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.etag = None + self.private_endpoint = None + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + self.link_identifier = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """Response for the ListPrivateEndpointConnection API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of PrivateEndpointConnection resources for a specific private link + service. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class PrivateEndpointListResult(msrest.serialization.Model): + """Response for the ListPrivateEndpoints API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of private endpoint resources in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class PrivateLinkService(Resource): + """Private link service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param load_balancer_frontend_ip_configurations: An array of references to the load balancer IP + configurations. + :type load_balancer_frontend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration] + :param ip_configurations: An array of private link service IP configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceIpConfiguration] + :ivar network_interfaces: An array of references to the network interfaces created for this + private link service. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar provisioning_state: The provisioning state of the private link service resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar private_endpoint_connections: An array of list about connections to the private endpoint. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection] + :param visibility: The visibility list of the private link service. + :type visibility: ~azure.mgmt.network.v2020_07_01.models.ResourceSet + :param auto_approval: The auto-approval list of the private link service. + :type auto_approval: ~azure.mgmt.network.v2020_07_01.models.ResourceSet + :param fqdns: The list of Fqdn. + :type fqdns: list[str] + :ivar alias: The alias of the private link service. + :vartype alias: str + :param enable_proxy_protocol: Whether the private link service is enabled for proxy protocol or + not. + :type enable_proxy_protocol: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'alias': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'load_balancer_frontend_ip_configurations': {'key': 'properties.loadBalancerFrontendIpConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[PrivateLinkServiceIpConfiguration]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'visibility': {'key': 'properties.visibility', 'type': 'ResourceSet'}, + 'auto_approval': {'key': 'properties.autoApproval', 'type': 'ResourceSet'}, + 'fqdns': {'key': 'properties.fqdns', 'type': '[str]'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'enable_proxy_protocol': {'key': 'properties.enableProxyProtocol', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkService, self).__init__(**kwargs) + self.etag = None + self.load_balancer_frontend_ip_configurations = kwargs.get('load_balancer_frontend_ip_configurations', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.network_interfaces = None + self.provisioning_state = None + self.private_endpoint_connections = None + self.visibility = kwargs.get('visibility', None) + self.auto_approval = kwargs.get('auto_approval', None) + self.fqdns = kwargs.get('fqdns', None) + self.alias = None + self.enable_proxy_protocol = kwargs.get('enable_proxy_protocol', None) + + +class PrivateLinkServiceConnection(SubResource): + """PrivateLinkServiceConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private link service connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_link_service_id: The resource id of private link service. + :type private_link_service_id: str + :param group_ids: The ID(s) of the group(s) obtained from the remote resource that this private + endpoint should connect to. + :type group_ids: list[str] + :param request_message: A message passed to the owner of the remote resource with this + connection request. Restricted to 140 chars. + :type request_message: str + :param private_link_service_connection_state: A collection of read-only information about the + state of the connection to the remote resource. + :type private_link_service_connection_state: + ~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_link_service_id': {'key': 'properties.privateLinkServiceId', 'type': 'str'}, + 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, + 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + self.etag = None + self.provisioning_state = None + self.private_link_service_id = kwargs.get('private_link_service_id', None) + self.group_ids = kwargs.get('group_ids', None) + self.request_message = kwargs.get('request_message', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. + :type status: str + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class PrivateLinkServiceIpConfiguration(SubResource): + """The private link service ip configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of private link service ip configuration. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param primary: Whether the ip configuration is primary or not. + :type primary: bool + :ivar provisioning_state: The provisioning state of the private link service IP configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceIpConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.provisioning_state = None + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + + +class PrivateLinkServiceListResult(msrest.serialization.Model): + """Response for the ListPrivateLinkService API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of PrivateLinkService resources in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ResourceSet(msrest.serialization.Model): + """The base resource set for visibility and auto-approval. + + :param subscriptions: The list of subscriptions. + :type subscriptions: list[str] + """ + + _attribute_map = { + 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSet, self).__init__(**kwargs) + self.subscriptions = kwargs.get('subscriptions', None) + + +class PrivateLinkServicePropertiesAutoApproval(ResourceSet): + """The auto-approval list of the private link service. + + :param subscriptions: The list of subscriptions. + :type subscriptions: list[str] + """ + + _attribute_map = { + 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServicePropertiesAutoApproval, self).__init__(**kwargs) + + +class PrivateLinkServicePropertiesVisibility(ResourceSet): + """The visibility list of the private link service. + + :param subscriptions: The list of subscriptions. + :type subscriptions: list[str] + """ + + _attribute_map = { + 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServicePropertiesVisibility, self).__init__(**kwargs) + + +class PrivateLinkServiceVisibility(msrest.serialization.Model): + """Response for the CheckPrivateLinkServiceVisibility API service call. + + :param visible: Private Link Service Visibility (True/False). + :type visible: bool + """ + + _attribute_map = { + 'visible': {'key': 'visible', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceVisibility, self).__init__(**kwargs) + self.visible = kwargs.get('visible', None) + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of probes used by the load + balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param protocol: The protocol of the end point. If 'Tcp' is specified, a received ACK is + required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. Possible values include: + "Http", "Tcp", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ProbeProtocol + :param port: The port for communicating the probe. Possible values range from 1 to 65535, + inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint + for health status. Typically, the interval is slightly less than half the allocated timeout + period (in seconds) which allows two full probes before taking the instance out of rotation. + The default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will result in stopping + further traffic from being delivered to the endpoint. This values allows endpoints to be taken + out of rotation faster or slower than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the VM. Path is required if + a protocol is set to http. Otherwise, it is not allowed. There is no default value. + :type request_path: str + :ivar provisioning_state: The provisioning state of the probe resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Probe, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.load_balancing_rules = None + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = None + + +class PropagatedRouteTable(msrest.serialization.Model): + """The list of RouteTables to advertise the routes to. + + :param labels: The list of labels. + :type labels: list[str] + :param ids: The list of resource ids of all the RouteTables. + :type ids: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _attribute_map = { + 'labels': {'key': 'labels', 'type': '[str]'}, + 'ids': {'key': 'ids', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PropagatedRouteTable, self).__init__(**kwargs) + self.labels = kwargs.get('labels', None) + self.ids = kwargs.get('ids', None) + + +class ProtocolConfiguration(msrest.serialization.Model): + """Configuration of the protocol. + + :param http_configuration: HTTP configuration of the connectivity check. + :type http_configuration: ~azure.mgmt.network.v2020_07_01.models.HTTPConfiguration + """ + + _attribute_map = { + 'http_configuration': {'key': 'HTTPConfiguration', 'type': 'HTTPConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtocolConfiguration, self).__init__(**kwargs) + self.http_configuration = kwargs.get('http_configuration', None) + + +class ProtocolCustomSettingsFormat(msrest.serialization.Model): + """DDoS custom policy properties. + + :param protocol: The protocol for which the DDoS protection policy is being customized. + Possible values include: "Tcp", "Udp", "Syn". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicyProtocol + :param trigger_rate_override: The customized DDoS protection trigger rate. + :type trigger_rate_override: str + :param source_rate_override: The customized DDoS protection source rate. + :type source_rate_override: str + :param trigger_sensitivity_override: The customized DDoS protection trigger rate sensitivity + degrees. High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger + rate set with moderate sensitivity w.r.t. normal traffic. Low: Trigger rate set with less + sensitivity w.r.t. normal traffic. Relaxed: Trigger rate set with least sensitivity w.r.t. + normal traffic. Possible values include: "Relaxed", "Low", "Default", "High". + :type trigger_sensitivity_override: str or + ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicyTriggerSensitivityOverride + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'trigger_rate_override': {'key': 'triggerRateOverride', 'type': 'str'}, + 'source_rate_override': {'key': 'sourceRateOverride', 'type': 'str'}, + 'trigger_sensitivity_override': {'key': 'triggerSensitivityOverride', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtocolCustomSettingsFormat, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.trigger_rate_override = kwargs.get('trigger_rate_override', None) + self.source_rate_override = kwargs.get('source_rate_override', None) + self.trigger_sensitivity_override = kwargs.get('trigger_sensitivity_override', None) + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the public ip address. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :param public_ip_allocation_method: The public IP address allocation method. Possible values + include: "Static", "Dynamic". + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible values include: + "IPv4", "IPv6". + :type public_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2020_07_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public IP address. + :type dns_settings: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressDnsSettings + :param ddos_settings: The DDoS protection custom policy associated with the public IP address. + :type ddos_settings: ~azure.mgmt.network.v2020_07_01.models.DdosSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2020_07_01.models.IpTag] + :param ip_address: The IP address associated with the public IP address resource. + :type ip_address: str + :param public_ip_prefix: The Public IP Prefix this Public IP Address should be allocated from. + :type public_ip_prefix: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :ivar resource_guid: The resource GUID property of the public IP address resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the public IP address resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ddos_settings': {'key': 'properties.ddosSettings', 'type': 'DdosSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddress, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.sku = kwargs.get('sku', None) + self.etag = None + self.zones = kwargs.get('zones', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) + self.ip_configuration = None + self.dns_settings = kwargs.get('dns_settings', None) + self.ddos_settings = kwargs.get('ddos_settings', None) + self.ip_tags = kwargs.get('ip_tags', None) + self.ip_address = kwargs.get('ip_address', None) + self.public_ip_prefix = kwargs.get('public_ip_prefix', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = None + self.provisioning_state = None + + +class PublicIPAddressDnsSettings(msrest.serialization.Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: The domain name label. The concatenation of the domain name label and + the regionalized DNS zone make up the fully qualified domain name associated with the public IP + address. If a domain name label is specified, an A DNS record is created for the public IP in + the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: The Fully Qualified Domain Name of the A DNS record associated with the public IP. + This is the concatenation of the domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: The reverse FQDN. A user-visible, fully qualified domain name that + resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is + created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) + + +class PublicIPAddressListResult(msrest.serialization.Model): + """Response for ListPublicIpAddresses API service call. + + :param value: A list of public IP addresses that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PublicIPAddress] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicIPAddress]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddressListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PublicIPAddressSku(msrest.serialization.Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: "Basic", "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressSkuName + :param tier: Tier of a public IP address SKU. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class PublicIPPrefix(Resource): + """Public IP prefix resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the public ip address. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :param sku: The public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :param public_ip_address_version: The public IP address version. Possible values include: + "IPv4", "IPv6". + :type public_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2020_07_01.models.IpTag] + :param prefix_length: The Length of the Public IP Prefix. + :type prefix_length: int + :ivar ip_prefix: The allocated Prefix. + :vartype ip_prefix: str + :ivar public_ip_addresses: The list of all referenced PublicIPAddresses. + :vartype public_ip_addresses: + list[~azure.mgmt.network.v2020_07_01.models.ReferencedPublicIpAddress] + :ivar load_balancer_frontend_ip_configuration: The reference to load balancer frontend IP + configuration associated with the public IP prefix. + :vartype load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.SubResource + :param custom_ip_prefix: The customIpPrefix that this prefix is associated with. + :type custom_ip_prefix: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar resource_guid: The resource GUID property of the public IP prefix resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the public IP prefix resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'ip_prefix': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'load_balancer_frontend_ip_configuration': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'PublicIPPrefixSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, + 'ip_prefix': {'key': 'properties.ipPrefix', 'type': 'str'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[ReferencedPublicIpAddress]'}, + 'load_balancer_frontend_ip_configuration': {'key': 'properties.loadBalancerFrontendIpConfiguration', 'type': 'SubResource'}, + 'custom_ip_prefix': {'key': 'properties.customIPPrefix', 'type': 'SubResource'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefix, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.sku = kwargs.get('sku', None) + self.etag = None + self.zones = kwargs.get('zones', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) + self.ip_tags = kwargs.get('ip_tags', None) + self.prefix_length = kwargs.get('prefix_length', None) + self.ip_prefix = None + self.public_ip_addresses = None + self.load_balancer_frontend_ip_configuration = None + self.custom_ip_prefix = kwargs.get('custom_ip_prefix', None) + self.resource_guid = None + self.provisioning_state = None + + +class PublicIPPrefixListResult(msrest.serialization.Model): + """Response for ListPublicIpPrefixes API service call. + + :param value: A list of public IP prefixes that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicIPPrefix]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefixListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PublicIPPrefixSku(msrest.serialization.Model): + """SKU of a public IP prefix. + + :param name: Name of a public IP prefix SKU. Possible values include: "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixSkuName + :param tier: Tier of a public IP prefix SKU. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefixSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class QosIpRange(msrest.serialization.Model): + """Qos Traffic Profiler IP Range properties. + + :param start_ip: Start IP Address. + :type start_ip: str + :param end_ip: End IP Address. + :type end_ip: str + """ + + _attribute_map = { + 'start_ip': {'key': 'startIP', 'type': 'str'}, + 'end_ip': {'key': 'endIP', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(QosIpRange, self).__init__(**kwargs) + self.start_ip = kwargs.get('start_ip', None) + self.end_ip = kwargs.get('end_ip', None) + + +class QosPortRange(msrest.serialization.Model): + """Qos Traffic Profiler Port range properties. + + :param start: Qos Port Range start. + :type start: int + :param end: Qos Port Range end. + :type end: int + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'int'}, + 'end': {'key': 'end', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(QosPortRange, self).__init__(**kwargs) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) + + +class QueryTroubleshootingParameters(msrest.serialization.Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting + result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + + +class RadiusServer(msrest.serialization.Model): + """Radius Server Settings. + + All required parameters must be populated in order to send to Azure. + + :param radius_server_address: Required. The address of this radius server. + :type radius_server_address: str + :param radius_server_score: The initial score assigned to this radius server. + :type radius_server_score: long + :param radius_server_secret: The secret used for this radius server. + :type radius_server_secret: str + """ + + _validation = { + 'radius_server_address': {'required': True}, + } + + _attribute_map = { + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_score': {'key': 'radiusServerScore', 'type': 'long'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RadiusServer, self).__init__(**kwargs) + self.radius_server_address = kwargs['radius_server_address'] + self.radius_server_score = kwargs.get('radius_server_score', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) + + +class RecordSet(msrest.serialization.Model): + """A collective group of information about the record set information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param record_type: Resource record type. + :type record_type: str + :param record_set_name: Recordset name. + :type record_set_name: str + :param fqdn: Fqdn that resolves to private endpoint ip address. + :type fqdn: str + :ivar provisioning_state: The provisioning state of the recordset. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param ttl: Recordset time to live. + :type ttl: int + :param ip_addresses: The private ip address of the private endpoint. + :type ip_addresses: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'record_type': {'key': 'recordType', 'type': 'str'}, + 'record_set_name': {'key': 'recordSetName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'ttl': {'key': 'ttl', 'type': 'int'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(RecordSet, self).__init__(**kwargs) + self.record_type = kwargs.get('record_type', None) + self.record_set_name = kwargs.get('record_set_name', None) + self.fqdn = kwargs.get('fqdn', None) + self.provisioning_state = None + self.ttl = kwargs.get('ttl', None) + self.ip_addresses = kwargs.get('ip_addresses', None) + + +class ReferencedPublicIpAddress(msrest.serialization.Model): + """Reference to a public IP address. + + :param id: The PublicIPAddress Reference. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReferencedPublicIpAddress, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource. + :type link: str + :ivar provisioning_state: The provisioning state of the resource navigation link resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) + self.provisioning_state = None + + +class ResourceNavigationLinksListResult(msrest.serialization.Model): + """Response for ResourceNavigationLinks_List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The resource navigation links in a subnet. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ResourceNavigationLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceNavigationLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNavigationLinksListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class RetentionPolicyParameters(msrest.serialization.Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. + :type days: int + :param enabled: Flag to enable/disable retention. + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) + + +class Route(SubResource): + """Route resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values + include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". + :type next_hop_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. Next hop values are + only allowed in routes where the next hop type is VirtualAppliance. + :type next_hop_ip_address: str + :ivar provisioning_state: The provisioning state of the route resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Route, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = None + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param rules: Collection of RouteFilterRules contained within a route filter. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the route filter resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'peerings': {'readonly': True}, + 'ipv6_peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'ipv6_peerings': {'key': 'properties.ipv6Peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteFilter, self).__init__(**kwargs) + self.etag = None + self.rules = kwargs.get('rules', None) + self.peerings = None + self.ipv6_peerings = None + self.provisioning_state = None + + +class RouteFilterListResult(msrest.serialization.Model): + """Response for the ListRouteFilters API service call. + + :param value: A list of route filters in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.RouteFilter] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RouteFilter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteFilterListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param access: The access type of the rule. Possible values include: "Allow", "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.Access + :param route_filter_rule_type: The rule type of the rule. Possible values include: "Community". + :type route_filter_rule_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteFilterRuleType + :param communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the route filter rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteFilterRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.etag = None + self.access = kwargs.get('access', None) + self.route_filter_rule_type = kwargs.get('route_filter_rule_type', None) + self.communities = kwargs.get('communities', None) + self.provisioning_state = None + + +class RouteFilterRuleListResult(msrest.serialization.Model): + """Response for the ListRouteFilterRules API service call. + + :param value: A list of RouteFilterRules in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RouteFilterRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteFilterRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RouteListResult(msrest.serialization.Model): + """Response for the ListRoute API service call. + + :param value: A list of routes in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Route] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Route]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :param disable_bgp_route_propagation: Whether to disable the routes learned by BGP on that + route table. True means disable. + :type disable_bgp_route_propagation: bool + :ivar provisioning_state: The provisioning state of the route table resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnets': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'disable_bgp_route_propagation': {'key': 'properties.disableBgpRoutePropagation', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteTable, self).__init__(**kwargs) + self.etag = None + self.routes = kwargs.get('routes', None) + self.subnets = None + self.disable_bgp_route_propagation = kwargs.get('disable_bgp_route_propagation', None) + self.provisioning_state = None + + +class RouteTableListResult(msrest.serialization.Model): + """Response for the ListRouteTable API service call. + + :param value: A list of route tables in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.RouteTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RouteTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RouteTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RoutingConfiguration(msrest.serialization.Model): + """Routing Configuration indicating the associated and propagated route tables for this connection. + + :param associated_route_table: The resource id RouteTable associated with this + RoutingConfiguration. + :type associated_route_table: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param propagated_route_tables: The list of RouteTables to advertise the routes to. + :type propagated_route_tables: ~azure.mgmt.network.v2020_07_01.models.PropagatedRouteTable + :param vnet_routes: List of routes that control routing from VirtualHub into a virtual network + connection. + :type vnet_routes: ~azure.mgmt.network.v2020_07_01.models.VnetRoute + """ + + _attribute_map = { + 'associated_route_table': {'key': 'associatedRouteTable', 'type': 'SubResource'}, + 'propagated_route_tables': {'key': 'propagatedRouteTables', 'type': 'PropagatedRouteTable'}, + 'vnet_routes': {'key': 'vnetRoutes', 'type': 'VnetRoute'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingConfiguration, self).__init__(**kwargs) + self.associated_route_table = kwargs.get('associated_route_table', None) + self.propagated_route_tables = kwargs.get('propagated_route_tables', None) + self.vnet_routes = kwargs.get('vnet_routes', None) + + +class SecurityGroupNetworkInterface(msrest.serialization.Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: All security rules associated with the network interface. + :type security_rule_associations: + ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) + + +class SecurityGroupViewParameters(msrest.serialization.Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + + +class SecurityGroupViewResult(msrest.serialization.Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2020_07_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + + +class SecurityPartnerProvider(Resource): + """Security Partner Provider resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the Security Partner Provider resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param security_provider_name: The security provider name. Possible values include: "ZScaler", + "IBoss", "Checkpoint". + :type security_provider_name: str or + ~azure.mgmt.network.v2020_07_01.models.SecurityProviderName + :ivar connection_status: The connection status with the Security Partner Provider. Possible + values include: "Unknown", "PartiallyConnected", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProviderConnectionStatus + :param virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'security_provider_name': {'key': 'properties.securityProviderName', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityPartnerProvider, self).__init__(**kwargs) + self.etag = None + self.provisioning_state = None + self.security_provider_name = kwargs.get('security_provider_name', None) + self.connection_status = None + self.virtual_hub = kwargs.get('virtual_hub', None) + + +class SecurityPartnerProviderListResult(msrest.serialization.Model): + """Response for ListSecurityPartnerProviders API service call. + + :param value: List of Security Partner Providers in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityPartnerProvider]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityPartnerProviderListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SecurityRule(SubResource): + """Network security rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Network protocol this rule applies to. Possible values include: "Tcp", "Udp", + "Icmp", "Esp", "*", "Ah". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range between 0 and 65535. + Asterisk '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or range between 0 and + 65535. Asterisk '*' can also be used to match all ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterisk '*' can also be used to + match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + can also be used. If this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or destination IP + range. Asterisk '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. CIDR or destination IP + ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security group specified as + destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: The network traffic is allowed or denied. Possible values include: "Allow", + "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :type priority: int + :param direction: The direction of the rule. The direction specifies if rule will be evaluated + on incoming or outgoing traffic. Possible values include: "Inbound", "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleDirection + :ivar provisioning_state: The provisioning state of the security rule resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.source_application_security_groups = kwargs.get('source_application_security_groups', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.destination_application_security_groups = kwargs.get('destination_application_security_groups', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = None + + +class SecurityRuleAssociations(msrest.serialization.Model): + """All security rules associated with the network interface. + + :param network_interface_association: Network interface and it's custom security rules. + :type network_interface_association: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceAssociation + :param subnet_association: Subnet and it's custom security rules. + :type subnet_association: ~azure.mgmt.network.v2020_07_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the network security + group. + :type default_security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + + +class SecurityRuleListResult(msrest.serialization.Model): + """Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group. + + :param value: The security rules in a network security group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ServiceAssociationLink(SubResource): + """ServiceAssociationLink resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource. + :type link: str + :ivar provisioning_state: The provisioning state of the service association link resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param allow_delete: If true, the resource can be deleted. + :type allow_delete: bool + :param locations: A list of locations. + :type locations: list[str] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'allow_delete': {'key': 'properties.allowDelete', 'type': 'bool'}, + 'locations': {'key': 'properties.locations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceAssociationLink, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) + self.provisioning_state = None + self.allow_delete = kwargs.get('allow_delete', None) + self.locations = kwargs.get('locations', None) + + +class ServiceAssociationLinksListResult(msrest.serialization.Model): + """Response for ServiceAssociationLinks_List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The service association links in a subnet. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ServiceAssociationLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceAssociationLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceAssociationLinksListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ServiceEndpointPolicy(Resource): + """Service End point policy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param service_endpoint_policy_definitions: A collection of service endpoint policy definitions + of the service endpoint policy. + :type service_endpoint_policy_definitions: + list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :ivar resource_guid: The resource GUID property of the service endpoint policy resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the service endpoint policy resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnets': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'service_endpoint_policy_definitions': {'key': 'properties.serviceEndpointPolicyDefinitions', 'type': '[ServiceEndpointPolicyDefinition]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceEndpointPolicy, self).__init__(**kwargs) + self.etag = None + self.service_endpoint_policy_definitions = kwargs.get('service_endpoint_policy_definitions', None) + self.subnets = None + self.resource_guid = None + self.provisioning_state = None + + +class ServiceEndpointPolicyDefinition(SubResource): + """Service Endpoint policy definitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param service: Service endpoint name. + :type service: str + :param service_resources: A list of service resources. + :type service_resources: list[str] + :ivar provisioning_state: The provisioning state of the service endpoint policy definition + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'service': {'key': 'properties.service', 'type': 'str'}, + 'service_resources': {'key': 'properties.serviceResources', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceEndpointPolicyDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.description = kwargs.get('description', None) + self.service = kwargs.get('service', None) + self.service_resources = kwargs.get('service_resources', None) + self.provisioning_state = None + + +class ServiceEndpointPolicyDefinitionListResult(msrest.serialization.Model): + """Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy. + + :param value: The service endpoint policy definition in a service endpoint policy. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceEndpointPolicyDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceEndpointPolicyDefinitionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ServiceEndpointPolicyListResult(msrest.serialization.Model): + """Response for ListServiceEndpointPolicies API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of ServiceEndpointPolicy resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceEndpointPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceEndpointPolicyListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ServiceEndpointPropertiesFormat(msrest.serialization.Model): + """The service endpoint properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :ivar provisioning_state: The provisioning state of the service endpoint resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = None + + +class ServiceTagInformation(msrest.serialization.Model): + """The service tag information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: Properties of the service tag information. + :vartype properties: + ~azure.mgmt.network.v2020_07_01.models.ServiceTagInformationPropertiesFormat + :ivar name: The name of service tag. + :vartype name: str + :ivar id: The ID of service tag. + :vartype id: str + """ + + _validation = { + 'properties': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ServiceTagInformationPropertiesFormat'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceTagInformation, self).__init__(**kwargs) + self.properties = None + self.name = None + self.id = None + + +class ServiceTagInformationPropertiesFormat(msrest.serialization.Model): + """Properties of the service tag information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar change_number: The iteration number of service tag. + :vartype change_number: str + :ivar region: The region of service tag. + :vartype region: str + :ivar system_service: The name of system service. + :vartype system_service: str + :ivar address_prefixes: The list of IP address prefixes. + :vartype address_prefixes: list[str] + """ + + _validation = { + 'change_number': {'readonly': True}, + 'region': {'readonly': True}, + 'system_service': {'readonly': True}, + 'address_prefixes': {'readonly': True}, + } + + _attribute_map = { + 'change_number': {'key': 'changeNumber', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'system_service': {'key': 'systemService', 'type': 'str'}, + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceTagInformationPropertiesFormat, self).__init__(**kwargs) + self.change_number = None + self.region = None + self.system_service = None + self.address_prefixes = None + + +class ServiceTagsListResult(msrest.serialization.Model): + """Response for the ListServiceTags API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the cloud. + :vartype name: str + :ivar id: The ID of the cloud. + :vartype id: str + :ivar type: The azure resource type. + :vartype type: str + :ivar change_number: The iteration number. + :vartype change_number: str + :ivar cloud: The name of the cloud. + :vartype cloud: str + :ivar values: The list of service tag information resources. + :vartype values: list[~azure.mgmt.network.v2020_07_01.models.ServiceTagInformation] + :ivar next_link: The URL to get next page of service tag information resources. + :vartype next_link: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'change_number': {'readonly': True}, + 'cloud': {'readonly': True}, + 'values': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'change_number': {'key': 'changeNumber', 'type': 'str'}, + 'cloud': {'key': 'cloud', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[ServiceTagInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceTagsListResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.change_number = None + self.cloud = None + self.values = None + self.next_link = None + + +class SessionIds(msrest.serialization.Model): + """List of session IDs. + + :param session_ids: List of session IDs. + :type session_ids: list[str] + """ + + _attribute_map = { + 'session_ids': {'key': 'sessionIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SessionIds, self).__init__(**kwargs) + self.session_ids = kwargs.get('session_ids', None) + + +class StaticRoute(msrest.serialization.Model): + """List of all Static Routes. + + :param name: The name of the StaticRoute that is unique within a VnetRoute. + :type name: str + :param address_prefixes: List of all address prefixes. + :type address_prefixes: list[str] + :param next_hop_ip_address: The ip address of the next hop. + :type next_hop_ip_address: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.address_prefixes = kwargs.get('address_prefixes', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param address_prefixes: List of address prefixes for the subnet. + :type address_prefixes: list[str] + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :param route_table: The reference to the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint] + :ivar ip_configurations: An array of references to the network interface IP configurations + using subnet. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.IPConfiguration] + :ivar ip_configuration_profiles: Array of IP configuration profiles which reference this + subnet. + :vartype ip_configuration_profiles: + list[~azure.mgmt.network.v2020_07_01.models.IPConfigurationProfile] + :param ip_allocations: Array of IpAllocation which reference this subnet. + :type ip_allocations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar resource_navigation_links: An array of references to the external resources using subnet. + :vartype resource_navigation_links: + list[~azure.mgmt.network.v2020_07_01.models.ResourceNavigationLink] + :ivar service_association_links: An array of references to services injecting into this subnet. + :vartype service_association_links: + list[~azure.mgmt.network.v2020_07_01.models.ServiceAssociationLink] + :param delegations: An array of references to the delegations on the subnet. + :type delegations: list[~azure.mgmt.network.v2020_07_01.models.Delegation] + :ivar purpose: A read-only string identifying the intention of use for this subnet based on + delegations and other user-defined properties. + :vartype purpose: str + :ivar provisioning_state: The provisioning state of the subnet resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_endpoint_network_policies: Enable or Disable apply network policies on private + end point in the subnet. + :type private_endpoint_network_policies: str + :param private_link_service_network_policies: Enable or Disable apply network policies on + private link service in the subnet. + :type private_link_service_network_policies: str + """ + + _validation = { + 'etag': {'readonly': True}, + 'private_endpoints': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + 'ip_configuration_profiles': {'readonly': True}, + 'resource_navigation_links': {'readonly': True}, + 'service_association_links': {'readonly': True}, + 'purpose': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'address_prefixes': {'key': 'properties.addressPrefixes', 'type': '[str]'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'nat_gateway': {'key': 'properties.natGateway', 'type': 'SubResource'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'service_endpoint_policies': {'key': 'properties.serviceEndpointPolicies', 'type': '[ServiceEndpointPolicy]'}, + 'private_endpoints': {'key': 'properties.privateEndpoints', 'type': '[PrivateEndpoint]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'ip_configuration_profiles': {'key': 'properties.ipConfigurationProfiles', 'type': '[IPConfigurationProfile]'}, + 'ip_allocations': {'key': 'properties.ipAllocations', 'type': '[SubResource]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'service_association_links': {'key': 'properties.serviceAssociationLinks', 'type': '[ServiceAssociationLink]'}, + 'delegations': {'key': 'properties.delegations', 'type': '[Delegation]'}, + 'purpose': {'key': 'properties.purpose', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_network_policies': {'key': 'properties.privateEndpointNetworkPolicies', 'type': 'str'}, + 'private_link_service_network_policies': {'key': 'properties.privateLinkServiceNetworkPolicies', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Subnet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.address_prefix = kwargs.get('address_prefix', None) + self.address_prefixes = kwargs.get('address_prefixes', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.nat_gateway = kwargs.get('nat_gateway', None) + self.service_endpoints = kwargs.get('service_endpoints', None) + self.service_endpoint_policies = kwargs.get('service_endpoint_policies', None) + self.private_endpoints = None + self.ip_configurations = None + self.ip_configuration_profiles = None + self.ip_allocations = kwargs.get('ip_allocations', None) + self.resource_navigation_links = None + self.service_association_links = None + self.delegations = kwargs.get('delegations', None) + self.purpose = None + self.provisioning_state = None + self.private_endpoint_network_policies = kwargs.get('private_endpoint_network_policies', None) + self.private_link_service_network_policies = kwargs.get('private_link_service_network_policies', None) + + +class SubnetAssociation(msrest.serialization.Model): + """Subnet and it's custom security rules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = kwargs.get('security_rules', None) + + +class SubnetListResult(msrest.serialization.Model): + """Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. + + :param value: The subnets in a virtual network. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Subnet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubnetListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class Topology(msrest.serialization.Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially created for the resource + group. + :vartype created_date_time: ~datetime.datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: ~datetime.datetime + :param resources: A list of topology resources. + :type resources: list[~azure.mgmt.network.v2020_07_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = kwargs.get('resources', None) + + +class TopologyAssociation(msrest.serialization.Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the parent resource. + Possible values include: "Associated", "Contains". + :type association_type: str or ~azure.mgmt.network.v2020_07_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) + + +class TopologyParameters(msrest.serialization.Model): + """Parameters that define the representation of topology. + + :param target_resource_group_name: The name of the target resource group to perform topology + on. + :type target_resource_group_name: str + :param target_virtual_network: The reference to the Virtual Network resource. + :type target_virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param target_subnet: The reference to the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + 'target_virtual_network': {'key': 'targetVirtualNetwork', 'type': 'SubResource'}, + 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, + } + + def __init__( + self, + **kwargs + ): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) + self.target_virtual_network = kwargs.get('target_virtual_network', None) + self.target_subnet = kwargs.get('target_subnet', None) + + +class TopologyResource(msrest.serialization.Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other resources in the + resource group. + :type associations: list[~azure.mgmt.network.v2020_07_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__( + self, + **kwargs + ): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) + + +class TrafficAnalyticsConfigurationProperties(msrest.serialization.Model): + """Parameters that define the configuration of traffic analytics. + + :param enabled: Flag to enable/disable traffic analytics. + :type enabled: bool + :param workspace_id: The resource guid of the attached workspace. + :type workspace_id: str + :param workspace_region: The location of the attached workspace. + :type workspace_region: str + :param workspace_resource_id: Resource Id of the attached workspace. + :type workspace_resource_id: str + :param traffic_analytics_interval: The interval in minutes which would decide how frequently TA + service should do flow analytics. + :type traffic_analytics_interval: int + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_region': {'key': 'workspaceRegion', 'type': 'str'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'traffic_analytics_interval': {'key': 'trafficAnalyticsInterval', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficAnalyticsConfigurationProperties, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.workspace_id = kwargs.get('workspace_id', None) + self.workspace_region = kwargs.get('workspace_region', None) + self.workspace_resource_id = kwargs.get('workspace_resource_id', None) + self.traffic_analytics_interval = kwargs.get('traffic_analytics_interval', None) + + +class TrafficAnalyticsProperties(msrest.serialization.Model): + """Parameters that define the configuration of traffic analytics. + + :param network_watcher_flow_analytics_configuration: Parameters that define the configuration + of traffic analytics. + :type network_watcher_flow_analytics_configuration: + ~azure.mgmt.network.v2020_07_01.models.TrafficAnalyticsConfigurationProperties + """ + + _attribute_map = { + 'network_watcher_flow_analytics_configuration': {'key': 'networkWatcherFlowAnalyticsConfiguration', 'type': 'TrafficAnalyticsConfigurationProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficAnalyticsProperties, self).__init__(**kwargs) + self.network_watcher_flow_analytics_configuration = kwargs.get('network_watcher_flow_analytics_configuration', None) + + +class TrafficSelectorPolicy(msrest.serialization.Model): + """An traffic selector policy for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param local_address_ranges: Required. A collection of local address spaces in CIDR format. + :type local_address_ranges: list[str] + :param remote_address_ranges: Required. A collection of remote address spaces in CIDR format. + :type remote_address_ranges: list[str] + """ + + _validation = { + 'local_address_ranges': {'required': True}, + 'remote_address_ranges': {'required': True}, + } + + _attribute_map = { + 'local_address_ranges': {'key': 'localAddressRanges', 'type': '[str]'}, + 'remote_address_ranges': {'key': 'remoteAddressRanges', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrafficSelectorPolicy, self).__init__(**kwargs) + self.local_address_ranges = kwargs['local_address_ranges'] + self.remote_address_ranges = kwargs['remote_address_ranges'] + + +class TroubleshootingDetails(msrest.serialization.Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2020_07_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__( + self, + **kwargs + ): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) + + +class TroubleshootingParameters(msrest.serialization.Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.storage_id = kwargs['storage_id'] + self.storage_path = kwargs['storage_path'] + + +class TroubleshootingRecommendedActions(msrest.serialization.Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended troubleshooting + actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended troubleshooting + actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) + + +class TroubleshootingResult(msrest.serialization.Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: ~datetime.datetime + :param end_time: The end time of the troubleshooting. + :type end_time: ~datetime.datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: list[~azure.mgmt.network.v2020_07_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) + + +class TunnelConnectionHealth(msrest.serialization.Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual Network Gateway connection status. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this connection. + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this connection. + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection was established in Utc + format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None + + +class UnprepareNetworkPoliciesRequest(msrest.serialization.Model): + """Details of UnprepareNetworkPolicies for Subnet. + + :param service_name: The name of the service for which subnet is being unprepared for. + :type service_name: str + """ + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UnprepareNetworkPoliciesRequest, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + + +class Usage(msrest.serialization.Model): + """The network resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :param unit: Required. An enum describing the unit of measurement. Possible values include: + "Count". + :type unit: str or ~azure.mgmt.network.v2020_07_01.models.UsageUnit + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2020_07_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + self.unit = kwargs['unit'] + self.current_value = kwargs['current_value'] + self.limit = kwargs['limit'] + self.name = kwargs['name'] + + +class UsageName(msrest.serialization.Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class UsagesListResult(msrest.serialization.Model): + """The list usages operation response. + + :param value: The list network resource usages. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Usage] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsagesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VerificationIPFlowParameters(msrest.serialization.Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a 5-tuple. Possible + values include: "Inbound", "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.IpFlowProtocol + :param local_port: Required. The local port. Acceptable values are a single integer in the + range (0-65535). Support for * for the source port, which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a single integer in the + range (0-65535). Support for * for the source port, which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values are valid IPv4 + addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable values are valid IPv4 + addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is + enabled on any of them, then this parameter must be specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.direction = kwargs['direction'] + self.protocol = kwargs['protocol'] + self.local_port = kwargs['local_port'] + self.remote_port = kwargs['remote_port'] + self.local_ip_address = kwargs['local_ip_address'] + self.remote_ip_address = kwargs['remote_ip_address'] + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) + + +class VerificationIPFlowResult(msrest.serialization.Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. Possible values include: + "Allow", "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any security rule, it is + not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) + + +class VirtualApplianceNicProperties(msrest.serialization.Model): + """Network Virtual Appliance NIC properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: NIC name. + :vartype name: str + :ivar public_ip_address: Public IP address. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP address. + :vartype private_ip_address: str + """ + + _validation = { + 'name': {'readonly': True}, + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplianceNicProperties, self).__init__(**kwargs) + self.name = None + self.public_ip_address = None + self.private_ip_address = None + + +class VirtualApplianceSite(SubResource): + """Virtual Appliance Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the virtual appliance site. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Site type. + :vartype type: str + :param address_prefix: Address Prefix. + :type address_prefix: str + :param o365_policy: Office 365 Policy. + :type o365_policy: ~azure.mgmt.network.v2020_07_01.models.Office365PolicyProperties + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'o365_policy': {'key': 'properties.o365Policy', 'type': 'Office365PolicyProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplianceSite, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.address_prefix = kwargs.get('address_prefix', None) + self.o365_policy = kwargs.get('o365_policy', None) + self.provisioning_state = None + + +class VirtualApplianceSkuProperties(msrest.serialization.Model): + """Network Virtual Appliance Sku Properties. + + :param vendor: Virtual Appliance Vendor. + :type vendor: str + :param bundled_scale_unit: Virtual Appliance Scale Unit. + :type bundled_scale_unit: str + :param market_place_version: Virtual Appliance Version. + :type market_place_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'bundled_scale_unit': {'key': 'bundledScaleUnit', 'type': 'str'}, + 'market_place_version': {'key': 'marketPlaceVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplianceSkuProperties, self).__init__(**kwargs) + self.vendor = kwargs.get('vendor', None) + self.bundled_scale_unit = kwargs.get('bundled_scale_unit', None) + self.market_place_version = kwargs.get('market_place_version', None) + + +class VirtualHub(Resource): + """VirtualHub Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_wan: The VirtualWAN to which the VirtualHub belongs. + :type virtual_wan: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param vpn_gateway: The VpnGateway associated with this VirtualHub. + :type vpn_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :type p2_s_vpn_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :type express_route_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param azure_firewall: The azureFirewall associated with this VirtualHub. + :type azure_firewall: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :type security_partner_provider: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param address_prefix: Address-prefix for this VirtualHub. + :type address_prefix: str + :param route_table: The routeTable associated with this virtual hub. + :type route_table: ~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTable + :ivar provisioning_state: The provisioning state of the virtual hub resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param security_provider_name: The Security Provider name. + :type security_provider_name: str + :param virtual_hub_route_table_v2_s: List of all virtual hub route table v2s associated with + this VirtualHub. + :type virtual_hub_route_table_v2_s: + list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2] + :param sku: The sku of this VirtualHub. + :type sku: str + :ivar routing_state: The routing state. Possible values include: "None", "Provisioned", + "Provisioning", "Failed". + :vartype routing_state: str or ~azure.mgmt.network.v2020_07_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param virtual_router_asn: VirtualRouter ASN. + :type virtual_router_asn: long + :param virtual_router_ips: VirtualRouter IPs. + :type virtual_router_ips: list[str] + :param allow_branch_to_branch_traffic: Flag to control transit for VirtualRouter hub. + :type allow_branch_to_branch_traffic: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'routing_state': {'readonly': True}, + 'bgp_connections': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + 'virtual_router_asn': {'maximum': 4294967295, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_wan': {'key': 'properties.virtualWan', 'type': 'SubResource'}, + 'vpn_gateway': {'key': 'properties.vpnGateway', 'type': 'SubResource'}, + 'p2_s_vpn_gateway': {'key': 'properties.p2SVpnGateway', 'type': 'SubResource'}, + 'express_route_gateway': {'key': 'properties.expressRouteGateway', 'type': 'SubResource'}, + 'azure_firewall': {'key': 'properties.azureFirewall', 'type': 'SubResource'}, + 'security_partner_provider': {'key': 'properties.securityPartnerProvider', 'type': 'SubResource'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'VirtualHubRouteTable'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'security_provider_name': {'key': 'properties.securityProviderName', 'type': 'str'}, + 'virtual_hub_route_table_v2_s': {'key': 'properties.virtualHubRouteTableV2s', 'type': '[VirtualHubRouteTableV2]'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'routing_state': {'key': 'properties.routingState', 'type': 'str'}, + 'bgp_connections': {'key': 'properties.bgpConnections', 'type': '[SubResource]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[SubResource]'}, + 'virtual_router_asn': {'key': 'properties.virtualRouterAsn', 'type': 'long'}, + 'virtual_router_ips': {'key': 'properties.virtualRouterIps', 'type': '[str]'}, + 'allow_branch_to_branch_traffic': {'key': 'properties.allowBranchToBranchTraffic', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHub, self).__init__(**kwargs) + self.etag = None + self.virtual_wan = kwargs.get('virtual_wan', None) + self.vpn_gateway = kwargs.get('vpn_gateway', None) + self.p2_s_vpn_gateway = kwargs.get('p2_s_vpn_gateway', None) + self.express_route_gateway = kwargs.get('express_route_gateway', None) + self.azure_firewall = kwargs.get('azure_firewall', None) + self.security_partner_provider = kwargs.get('security_partner_provider', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.route_table = kwargs.get('route_table', None) + self.provisioning_state = None + self.security_provider_name = kwargs.get('security_provider_name', None) + self.virtual_hub_route_table_v2_s = kwargs.get('virtual_hub_route_table_v2_s', None) + self.sku = kwargs.get('sku', None) + self.routing_state = None + self.bgp_connections = None + self.ip_configurations = None + self.virtual_router_asn = kwargs.get('virtual_router_asn', None) + self.virtual_router_ips = kwargs.get('virtual_router_ips', None) + self.allow_branch_to_branch_traffic = kwargs.get('allow_branch_to_branch_traffic', None) + + +class VirtualHubEffectiveRoute(msrest.serialization.Model): + """The effective route configured on the virtual hub or specified resource. + + :param address_prefixes: The list of address prefixes. + :type address_prefixes: list[str] + :param next_hops: The list of next hops. + :type next_hops: list[str] + :param next_hop_type: The type of the next hop. + :type next_hop_type: str + :param as_path: The ASPath of this route. + :type as_path: str + :param route_origin: The origin of this route. + :type route_origin: str + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'next_hops': {'key': 'nextHops', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'route_origin': {'key': 'routeOrigin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubEffectiveRoute, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) + self.next_hops = kwargs.get('next_hops', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.as_path = kwargs.get('as_path', None) + self.route_origin = kwargs.get('route_origin', None) + + +class VirtualHubEffectiveRouteList(msrest.serialization.Model): + """EffectiveRoutes List. + + :param value: The list of effective routes configured on the virtual hub or the specified + resource. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubEffectiveRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualHubEffectiveRoute]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubEffectiveRouteList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VirtualHubId(msrest.serialization.Model): + """Virtual Hub identifier. + + :param id: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be + deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same + subscription. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubId, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class VirtualHubRoute(msrest.serialization.Model): + """VirtualHub route. + + :param address_prefixes: List of all addressPrefixes. + :type address_prefixes: list[str] + :param next_hop_ip_address: NextHop ip address. + :type next_hop_ip_address: str + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubRoute, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + + +class VirtualHubRouteTable(msrest.serialization.Model): + """VirtualHub route table. + + :param routes: List of all routes. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[VirtualHubRoute]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubRouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + + +class VirtualHubRouteTableV2(SubResource): + """VirtualHubRouteTableV2 Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param routes: List of all routes. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteV2] + :param attached_connections: List of all connections attached to this route table v2. + :type attached_connections: list[str] + :ivar provisioning_state: The provisioning state of the virtual hub route table v2 resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VirtualHubRouteV2]'}, + 'attached_connections': {'key': 'properties.attachedConnections', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubRouteTableV2, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.routes = kwargs.get('routes', None) + self.attached_connections = kwargs.get('attached_connections', None) + self.provisioning_state = None + + +class VirtualHubRouteV2(msrest.serialization.Model): + """VirtualHubRouteTableV2 route. + + :param destination_type: The type of destinations. + :type destination_type: str + :param destinations: List of all destinations. + :type destinations: list[str] + :param next_hop_type: The type of next hops. + :type next_hop_type: str + :param next_hops: NextHops ip address. + :type next_hops: list[str] + """ + + _attribute_map = { + 'destination_type': {'key': 'destinationType', 'type': 'str'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hops': {'key': 'nextHops', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualHubRouteV2, self).__init__(**kwargs) + self.destination_type = kwargs.get('destination_type', None) + self.destinations = kwargs.get('destinations', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hops = kwargs.get('next_hops', None) + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the virtual network. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param address_space: The AddressSpace that contains an array of IP address ranges that can be + used by subnets. + :type address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers available to VMs + deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2020_07_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering] + :ivar resource_guid: The resourceGuid property of the Virtual Network resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param enable_ddos_protection: Indicates if DDoS protection is enabled for all the protected + resources in the virtual network. It requires a DDoS protection plan associated with the + resource. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if VM protection is enabled for all the subnets in the + virtual network. + :type enable_vm_protection: bool + :param ddos_protection_plan: The DDoS protection plan associated with the virtual network. + :type ddos_protection_plan: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param bgp_communities: Bgp Communities sent over ExpressRoute with each route corresponding to + a prefix in this VNET. + :type bgp_communities: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkBgpCommunities + :param ip_allocations: Array of IpAllocation which reference this VNET. + :type ip_allocations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'ddos_protection_plan': {'key': 'properties.ddosProtectionPlan', 'type': 'SubResource'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': 'VirtualNetworkBgpCommunities'}, + 'ip_allocations': {'key': 'properties.ipAllocations', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetwork, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.etag = None + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = None + self.provisioning_state = None + self.enable_ddos_protection = kwargs.get('enable_ddos_protection', False) + self.enable_vm_protection = kwargs.get('enable_vm_protection', False) + self.ddos_protection_plan = kwargs.get('ddos_protection_plan', None) + self.bgp_communities = kwargs.get('bgp_communities', None) + self.ip_allocations = kwargs.get('ip_allocations', None) + + +class VirtualNetworkBgpCommunities(msrest.serialization.Model): + """Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_community: Required. The BGP community associated with the virtual + network. + :type virtual_network_community: str + :ivar regional_community: The BGP community associated with the region of the virtual network. + :vartype regional_community: str + """ + + _validation = { + 'virtual_network_community': {'required': True}, + 'regional_community': {'readonly': True}, + } + + _attribute_map = { + 'virtual_network_community': {'key': 'virtualNetworkCommunity', 'type': 'str'}, + 'regional_community': {'key': 'regionalCommunity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkBgpCommunities, self).__init__(**kwargs) + self.virtual_network_community = kwargs['virtual_network_community'] + self.regional_community = None + + +class VirtualNetworkConnectionGatewayReference(msrest.serialization.Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs['id'] + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible values include: "Vpn", + "ExpressRoute", "LocalGateway". + :type gateway_type: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values include: + "PolicyBased", "RouteBased". + :type vpn_type: str or ~azure.mgmt.network.v2020_07_01.models.VpnType + :param vpn_gateway_generation: The generation for this VirtualNetworkGateway. Must be None if + gatewayType is not VPN. Possible values include: "None", "Generation1", "Generation2". + :type vpn_gateway_generation: str or + ~azure.mgmt.network.v2020_07_01.models.VpnGatewayGeneration + :param enable_bgp: Whether BGP is enabled for this virtual network gateway or not. + :type enable_bgp: bool + :param enable_private_ip_address: Whether private IP needs to be enabled on this gateway for + connections or not. + :type enable_private_ip_address: bool + :param active: ActiveActive flag. + :type active: bool + :param gateway_default_site: The reference to the LocalNetworkGateway resource which represents + local network site having default routes. Assign Null value in case of removing existing + default site setting. + :type gateway_default_site: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param sku: The reference to the VirtualNetworkGatewaySku resource which represents the SKU + selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference to the VpnClientConfiguration resource which + represents the P2S VpnClient configurations. + :type vpn_client_configuration: ~azure.mgmt.network.v2020_07_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :param custom_routes: The reference to the address space resource which represents the custom + routes address space specified by the customer for virtual network gateway and VpnClient. + :type custom_routes: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :ivar resource_guid: The resource GUID property of the virtual network gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param enable_dns_forwarding: Whether dns forwarding is enabled or not. + :type enable_dns_forwarding: bool + :ivar inbound_dns_forwarding_endpoint: The IP address allocated by the gateway to which dns + requests can be sent. + :vartype inbound_dns_forwarding_endpoint: str + :param virtual_network_extended_location_resource_id: MAS FIJI customer vnet resource id. + VirtualNetworkGateway of type local gateway is associated with the customer vnet. + :type virtual_network_extended_location_resource_id: str + :param extended_location: The extended location of type local virtual network gateway. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'inbound_dns_forwarding_endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'vpn_gateway_generation': {'key': 'properties.vpnGatewayGeneration', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'enable_private_ip_address': {'key': 'properties.enablePrivateIpAddress', 'type': 'bool'}, + 'active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'custom_routes': {'key': 'properties.customRoutes', 'type': 'AddressSpace'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_dns_forwarding': {'key': 'properties.enableDnsForwarding', 'type': 'bool'}, + 'inbound_dns_forwarding_endpoint': {'key': 'properties.inboundDnsForwardingEndpoint', 'type': 'str'}, + 'virtual_network_extended_location_resource_id': {'key': 'properties.virtualNetworkExtendedLocationResourceId', 'type': 'str'}, + 'extended_location': {'key': 'properties.extendedLocation', 'type': 'ExtendedLocation'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.etag = None + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.vpn_gateway_generation = kwargs.get('vpn_gateway_generation', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.enable_private_ip_address = kwargs.get('enable_private_ip_address', None) + self.active = kwargs.get('active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.custom_routes = kwargs.get('custom_routes', None) + self.resource_guid = None + self.provisioning_state = None + self.enable_dns_forwarding = kwargs.get('enable_dns_forwarding', None) + self.inbound_dns_forwarding_endpoint = None + self.virtual_network_extended_location_resource_id = kwargs.get('virtual_network_extended_location_resource_id', None) + self.extended_location = kwargs.get('extended_location', None) + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. + :type virtual_network_gateway1: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values include: "IPsec", + "Vnet2Vnet", "ExpressRoute", "VPNClient". + :type connection_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionType + :param connection_protocol: Connection protocol used for this connection. Possible values + include: "IKEv2", "IKEv1". + :type connection_protocol: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :param dpd_timeout_seconds: The dead peer detection timeout of this connection in seconds. + :type dpd_timeout_seconds: int + :param connection_mode: The connection mode for this connection. Possible values include: + "Default", "ResponderOnly", "InitiatorOnly". + :type connection_mode: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionMode + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual Network Gateway connection status. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_07_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_local_azure_ip_address: Use private local Azure IP for the connection. + :type use_local_azure_ip_address: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :type traffic_selector_policies: + list[~azure.mgmt.network.v2020_07_01.models.TrafficSelectorPolicy] + :ivar resource_guid: The resource GUID property of the virtual network gateway connection + resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :type express_route_gateway_bypass: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'connection_protocol': {'key': 'properties.connectionProtocol', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'dpd_timeout_seconds': {'key': 'properties.dpdTimeoutSeconds', 'type': 'int'}, + 'connection_mode': {'key': 'properties.connectionMode', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_local_azure_ip_address': {'key': 'properties.useLocalAzureIpAddress', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'traffic_selector_policies': {'key': 'properties.trafficSelectorPolicies', 'type': '[TrafficSelectorPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_gateway_bypass': {'key': 'properties.expressRouteGatewayBypass', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.etag = None + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs['virtual_network_gateway1'] + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs['connection_type'] + self.connection_protocol = kwargs.get('connection_protocol', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.dpd_timeout_seconds = kwargs.get('dpd_timeout_seconds', None) + self.connection_mode = kwargs.get('connection_mode', None) + self.shared_key = kwargs.get('shared_key', None) + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_local_azure_ip_address = kwargs.get('use_local_azure_ip_address', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.traffic_selector_policies = kwargs.get('traffic_selector_policies', None) + self.resource_guid = None + self.provisioning_state = None + self.express_route_gateway_bypass = kwargs.get('express_route_gateway_bypass', None) + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values include: "IPsec", + "Vnet2Vnet", "ExpressRoute", "VPNClient". + :type connection_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionType + :param connection_protocol: Connection protocol used for this connection. Possible values + include: "IKEv2", "IKEv1". + :type connection_protocol: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :param connection_mode: The connection mode for this connection. Possible values include: + "Default", "ResponderOnly", "InitiatorOnly". + :type connection_mode: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionMode + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual Network Gateway connection status. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_07_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :type traffic_selector_policies: + list[~azure.mgmt.network.v2020_07_01.models.TrafficSelectorPolicy] + :ivar resource_guid: The resource GUID property of the virtual network gateway connection + resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :type express_route_gateway_bypass: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'connection_protocol': {'key': 'properties.connectionProtocol', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'connection_mode': {'key': 'properties.connectionMode', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'traffic_selector_policies': {'key': 'properties.trafficSelectorPolicies', 'type': '[TrafficSelectorPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_gateway_bypass': {'key': 'properties.expressRouteGatewayBypass', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.etag = None + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs['virtual_network_gateway1'] + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs['connection_type'] + self.connection_protocol = kwargs.get('connection_protocol', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.connection_mode = kwargs.get('connection_mode', None) + self.shared_key = kwargs.get('shared_key', None) + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.traffic_selector_policies = kwargs.get('traffic_selector_policies', None) + self.resource_guid = None + self.provisioning_state = None + self.express_route_gateway_bypass = kwargs.get('express_route_gateway_bypass', None) + + +class VirtualNetworkGatewayConnectionListResult(msrest.serialization.Model): + """Response for the ListVirtualNetworkGatewayConnections API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewayConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar private_ip_address: Private IP Address for this gateway. + :vartype private_ip_address: str + :ivar provisioning_state: The provisioning state of the virtual network gateway IP + configuration resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.private_ip_address = None + self.provisioning_state = None + + +class VirtualNetworkGatewayListConnectionsResult(msrest.serialization.Model): + """Response for the VirtualNetworkGatewayListConnections API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :type value: + list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionListEntity] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnectionListEntity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewayListConnectionsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class VirtualNetworkGatewayListResult(msrest.serialization.Model): + """Response for the ListVirtualNetworkGateways API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of VirtualNetworkGateway resources that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewayListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class VirtualNetworkGatewaySku(msrest.serialization.Model): + """VirtualNetworkGatewaySku details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Gateway SKU name. Possible values include: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewaySkuTier + :ivar capacity: The capacity. + :vartype capacity: int + """ + + _validation = { + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = None + + +class VirtualNetworkListResult(msrest.serialization.Model): + """Response for the ListVirtualNetworks API service call. + + :param value: A list of VirtualNetwork resources in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetwork] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VirtualNetworkListUsageResult(msrest.serialization.Model): + """Response for the virtual networks GetUsage API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: VirtualNetwork usage stats. + :vartype value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkUsage] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkUsage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkListUsageResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param allow_virtual_network_access: Whether the VMs in the local virtual network space would + be able to access the VMs in remote virtual network space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs in the local virtual + network will be allowed/disallowed in remote virtual network. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote virtual networking to link + to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual network. If the flag + is set to true, and allowGatewayTransit on remote peering is also true, virtual network will + use gateways of remote virtual network for transit. Only one peering can have this flag set to + true. This flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference to the remote virtual network. The remote virtual + network can be in the same or different region (preview). See here to register for the preview + and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create- + peering). + :type remote_virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param remote_address_space: The reference to the remote virtual network address space. + :type remote_address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param remote_bgp_communities: The reference to the remote virtual network's Bgp Communities. + :type remote_bgp_communities: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkBgpCommunities + :param peering_state: The status of the virtual network peering. Possible values include: + "Initiated", "Connected", "Disconnected". + :type peering_state: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeeringState + :ivar provisioning_state: The provisioning state of the virtual network peering resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'remote_bgp_communities': {'key': 'properties.remoteBgpCommunities', 'type': 'VirtualNetworkBgpCommunities'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.remote_address_space = kwargs.get('remote_address_space', None) + self.remote_bgp_communities = kwargs.get('remote_bgp_communities', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = None + + +class VirtualNetworkPeeringListResult(msrest.serialization.Model): + """Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. + + :param value: The peerings in a virtual network. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkPeeringListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VirtualNetworkTap(Resource): + """Virtual Network Tap resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar network_interface_tap_configurations: Specifies the list of resource IDs for the network + interface IP configuration that needs to be tapped. + :vartype network_interface_tap_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :ivar resource_guid: The resource GUID property of the virtual network tap resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network tap resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param destination_network_interface_ip_configuration: The reference to the private IP Address + of the collector nic that will receive the tap. + :type destination_network_interface_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :param destination_load_balancer_front_end_ip_configuration: The reference to the private IP + address on the internal Load Balancer that will receive the tap. + :type destination_load_balancer_front_end_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration + :param destination_port: The VXLAN destination port that will receive the tapped traffic. + :type destination_port: int + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'network_interface_tap_configurations': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'network_interface_tap_configurations': {'key': 'properties.networkInterfaceTapConfigurations', 'type': '[NetworkInterfaceTapConfiguration]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'destination_network_interface_ip_configuration': {'key': 'properties.destinationNetworkInterfaceIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'destination_load_balancer_front_end_ip_configuration': {'key': 'properties.destinationLoadBalancerFrontEndIPConfiguration', 'type': 'FrontendIPConfiguration'}, + 'destination_port': {'key': 'properties.destinationPort', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkTap, self).__init__(**kwargs) + self.etag = None + self.network_interface_tap_configurations = None + self.resource_guid = None + self.provisioning_state = None + self.destination_network_interface_ip_configuration = kwargs.get('destination_network_interface_ip_configuration', None) + self.destination_load_balancer_front_end_ip_configuration = kwargs.get('destination_load_balancer_front_end_ip_configuration', None) + self.destination_port = kwargs.get('destination_port', None) + + +class VirtualNetworkTapListResult(msrest.serialization.Model): + """Response for ListVirtualNetworkTap API service call. + + :param value: A list of VirtualNetworkTaps in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkTap]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkTapListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VirtualNetworkUsage(msrest.serialization.Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count'. + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None + + +class VirtualNetworkUsageName(msrest.serialization.Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None + + +class VirtualRouter(Resource): + """VirtualRouter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_router_asn: VirtualRouter ASN. + :type virtual_router_asn: long + :param virtual_router_ips: VirtualRouter IPs. + :type virtual_router_ips: list[str] + :param hosted_subnet: The Subnet on which VirtualRouter is hosted. + :type hosted_subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param hosted_gateway: The Gateway on which VirtualRouter is hosted. + :type hosted_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_router_asn': {'maximum': 4294967295, 'minimum': 0}, + 'peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_router_asn': {'key': 'properties.virtualRouterAsn', 'type': 'long'}, + 'virtual_router_ips': {'key': 'properties.virtualRouterIps', 'type': '[str]'}, + 'hosted_subnet': {'key': 'properties.hostedSubnet', 'type': 'SubResource'}, + 'hosted_gateway': {'key': 'properties.hostedGateway', 'type': 'SubResource'}, + 'peerings': {'key': 'properties.peerings', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualRouter, self).__init__(**kwargs) + self.etag = None + self.virtual_router_asn = kwargs.get('virtual_router_asn', None) + self.virtual_router_ips = kwargs.get('virtual_router_ips', None) + self.hosted_subnet = kwargs.get('hosted_subnet', None) + self.hosted_gateway = kwargs.get('hosted_gateway', None) + self.peerings = None + self.provisioning_state = None + + +class VirtualRouterListResult(msrest.serialization.Model): + """Response for ListVirtualRouters API service call. + + :param value: List of Virtual Routers. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualRouter] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualRouter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualRouterListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VirtualRouterPeering(SubResource): + """Virtual Router Peering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the virtual router peering that is unique within a virtual router. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Peering type. + :vartype type: str + :param peer_asn: Peer ASN. + :type peer_asn: long + :param peer_ip: Peer IP. + :type peer_ip: str + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peer_asn': {'key': 'properties.peerAsn', 'type': 'long'}, + 'peer_ip': {'key': 'properties.peerIp', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualRouterPeering, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.peer_asn = kwargs.get('peer_asn', None) + self.peer_ip = kwargs.get('peer_ip', None) + self.provisioning_state = None + + +class VirtualRouterPeeringListResult(msrest.serialization.Model): + """Response for ListVirtualRouterPeerings API service call. + + :param value: List of VirtualRouterPeerings in a VirtualRouter. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualRouterPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualRouterPeeringListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VirtualWAN(Resource): + """VirtualWAN Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param disable_vpn_encryption: Vpn encryption to be disabled or not. + :type disable_vpn_encryption: bool + :ivar virtual_hubs: List of VirtualHubs in the VirtualWAN. + :vartype virtual_hubs: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param allow_branch_to_branch_traffic: True if branch to branch traffic is allowed. + :type allow_branch_to_branch_traffic: bool + :param allow_vnet_to_vnet_traffic: True if Vnet to Vnet traffic is allowed. + :type allow_vnet_to_vnet_traffic: bool + :ivar office365_local_breakout_category: The office local breakout category. Possible values + include: "Optimize", "OptimizeAndAllow", "All", "None". + :vartype office365_local_breakout_category: str or + ~azure.mgmt.network.v2020_07_01.models.OfficeTrafficCategory + :ivar provisioning_state: The provisioning state of the virtual WAN resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param type_properties_type: The type of the VirtualWAN. + :type type_properties_type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_hubs': {'readonly': True}, + 'vpn_sites': {'readonly': True}, + 'office365_local_breakout_category': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'disable_vpn_encryption': {'key': 'properties.disableVpnEncryption', 'type': 'bool'}, + 'virtual_hubs': {'key': 'properties.virtualHubs', 'type': '[SubResource]'}, + 'vpn_sites': {'key': 'properties.vpnSites', 'type': '[SubResource]'}, + 'allow_branch_to_branch_traffic': {'key': 'properties.allowBranchToBranchTraffic', 'type': 'bool'}, + 'allow_vnet_to_vnet_traffic': {'key': 'properties.allowVnetToVnetTraffic', 'type': 'bool'}, + 'office365_local_breakout_category': {'key': 'properties.office365LocalBreakoutCategory', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualWAN, self).__init__(**kwargs) + self.etag = None + self.disable_vpn_encryption = kwargs.get('disable_vpn_encryption', None) + self.virtual_hubs = None + self.vpn_sites = None + self.allow_branch_to_branch_traffic = kwargs.get('allow_branch_to_branch_traffic', None) + self.allow_vnet_to_vnet_traffic = kwargs.get('allow_vnet_to_vnet_traffic', None) + self.office365_local_breakout_category = None + self.provisioning_state = None + self.type_properties_type = kwargs.get('type_properties_type', None) + + +class VirtualWanSecurityProvider(msrest.serialization.Model): + """Collection of SecurityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of the security provider. + :type name: str + :param url: Url of the security provider. + :type url: str + :ivar type: Name of the security provider. Possible values include: "External", "Native". + :vartype type: str or ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviderType + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualWanSecurityProvider, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.url = kwargs.get('url', None) + self.type = None + + +class VirtualWanSecurityProviders(msrest.serialization.Model): + """Collection of SecurityProviders. + + :param supported_providers: List of VirtualWAN security providers. + :type supported_providers: + list[~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProvider] + """ + + _attribute_map = { + 'supported_providers': {'key': 'supportedProviders', 'type': '[VirtualWanSecurityProvider]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualWanSecurityProviders, self).__init__(**kwargs) + self.supported_providers = kwargs.get('supported_providers', None) + + +class VirtualWanVpnProfileParameters(msrest.serialization.Model): + """Virtual Wan Vpn profile parameters Vpn profile generation. + + :param vpn_server_configuration_resource_id: VpnServerConfiguration partial resource uri with + which VirtualWan is associated to. + :type vpn_server_configuration_resource_id: str + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_07_01.models.AuthenticationMethod + """ + + _attribute_map = { + 'vpn_server_configuration_resource_id': {'key': 'vpnServerConfigurationResourceId', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualWanVpnProfileParameters, self).__init__(**kwargs) + self.vpn_server_configuration_resource_id = kwargs.get('vpn_server_configuration_resource_id', None) + self.authentication_method = kwargs.get('authentication_method', None) + + +class VM(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(VM, self).__init__(**kwargs) + + +class VnetRoute(msrest.serialization.Model): + """List of routes that control routing from VirtualHub into a virtual network connection. + + :param static_routes: List of all Static Routes. + :type static_routes: list[~azure.mgmt.network.v2020_07_01.models.StaticRoute] + """ + + _attribute_map = { + 'static_routes': {'key': 'staticRoutes', 'type': '[StaticRoute]'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetRoute, self).__init__(**kwargs) + self.static_routes = kwargs.get('static_routes', None) + + +class VpnClientConfiguration(msrest.serialization.Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :type vpn_client_address_pool: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.VpnClientProtocol] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for virtual network gateway P2S + client. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param radius_server_address: The radius server address property of the VirtualNetworkGateway + resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the VirtualNetworkGateway resource + for vpn client connection. + :type radius_server_secret: str + :param radius_servers: The radiusServers property for multiple radius server configuration. + :type radius_servers: list[~azure.mgmt.network.v2020_07_01.models.RadiusServer] + :param aad_tenant: The AADTenant property of the VirtualNetworkGateway resource for vpn client + connection used for AAD authentication. + :type aad_tenant: str + :param aad_audience: The AADAudience property of the VirtualNetworkGateway resource for vpn + client connection used for AAD authentication. + :type aad_audience: str + :param aad_issuer: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + connection used for AAD authentication. + :type aad_issuer: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'vpn_client_ipsec_policies': {'key': 'vpnClientIpsecPolicies', 'type': '[IpsecPolicy]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + 'radius_servers': {'key': 'radiusServers', 'type': '[RadiusServer]'}, + 'aad_tenant': {'key': 'aadTenant', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + 'aad_issuer': {'key': 'aadIssuer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.vpn_client_ipsec_policies = kwargs.get('vpn_client_ipsec_policies', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) + self.radius_servers = kwargs.get('radius_servers', None) + self.aad_tenant = kwargs.get('aad_tenant', None) + self.aad_audience = kwargs.get('aad_audience', None) + self.aad_issuer = kwargs.get('aad_issuer', None) + + +class VpnClientConnectionHealth(msrest.serialization.Model): + """VpnClientConnectionHealth properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar total_ingress_bytes_transferred: Total of the Ingress Bytes Transferred in this P2S Vpn + connection. + :vartype total_ingress_bytes_transferred: long + :ivar total_egress_bytes_transferred: Total of the Egress Bytes Transferred in this connection. + :vartype total_egress_bytes_transferred: long + :param vpn_client_connections_count: The total of p2s vpn clients connected at this time to + this P2SVpnGateway. + :type vpn_client_connections_count: int + :param allocated_ip_addresses: List of allocated ip addresses to the connected p2s vpn clients. + :type allocated_ip_addresses: list[str] + """ + + _validation = { + 'total_ingress_bytes_transferred': {'readonly': True}, + 'total_egress_bytes_transferred': {'readonly': True}, + } + + _attribute_map = { + 'total_ingress_bytes_transferred': {'key': 'totalIngressBytesTransferred', 'type': 'long'}, + 'total_egress_bytes_transferred': {'key': 'totalEgressBytesTransferred', 'type': 'long'}, + 'vpn_client_connections_count': {'key': 'vpnClientConnectionsCount', 'type': 'int'}, + 'allocated_ip_addresses': {'key': 'allocatedIpAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientConnectionHealth, self).__init__(**kwargs) + self.total_ingress_bytes_transferred = None + self.total_egress_bytes_transferred = None + self.vpn_client_connections_count = kwargs.get('vpn_client_connections_count', None) + self.allocated_ip_addresses = kwargs.get('allocated_ip_addresses', None) + + +class VpnClientConnectionHealthDetail(msrest.serialization.Model): + """VPN client connection health detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vpn_connection_id: The vpn client Id. + :vartype vpn_connection_id: str + :ivar vpn_connection_duration: The duration time of a connected vpn client. + :vartype vpn_connection_duration: long + :ivar vpn_connection_time: The start time of a connected vpn client. + :vartype vpn_connection_time: str + :ivar public_ip_address: The public Ip of a connected vpn client. + :vartype public_ip_address: str + :ivar private_ip_address: The assigned private Ip of a connected vpn client. + :vartype private_ip_address: str + :ivar vpn_user_name: The user name of a connected vpn client. + :vartype vpn_user_name: str + :ivar max_bandwidth: The max band width. + :vartype max_bandwidth: long + :ivar egress_packets_transferred: The egress packets per second. + :vartype egress_packets_transferred: long + :ivar egress_bytes_transferred: The egress bytes per second. + :vartype egress_bytes_transferred: long + :ivar ingress_packets_transferred: The ingress packets per second. + :vartype ingress_packets_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes per second. + :vartype ingress_bytes_transferred: long + :ivar max_packets_per_second: The max packets transferred per second. + :vartype max_packets_per_second: long + """ + + _validation = { + 'vpn_connection_id': {'readonly': True}, + 'vpn_connection_duration': {'readonly': True}, + 'vpn_connection_time': {'readonly': True}, + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'vpn_user_name': {'readonly': True}, + 'max_bandwidth': {'readonly': True}, + 'egress_packets_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_packets_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'max_packets_per_second': {'readonly': True}, + } + + _attribute_map = { + 'vpn_connection_id': {'key': 'vpnConnectionId', 'type': 'str'}, + 'vpn_connection_duration': {'key': 'vpnConnectionDuration', 'type': 'long'}, + 'vpn_connection_time': {'key': 'vpnConnectionTime', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'vpn_user_name': {'key': 'vpnUserName', 'type': 'str'}, + 'max_bandwidth': {'key': 'maxBandwidth', 'type': 'long'}, + 'egress_packets_transferred': {'key': 'egressPacketsTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'ingress_packets_transferred': {'key': 'ingressPacketsTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'max_packets_per_second': {'key': 'maxPacketsPerSecond', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientConnectionHealthDetail, self).__init__(**kwargs) + self.vpn_connection_id = None + self.vpn_connection_duration = None + self.vpn_connection_time = None + self.public_ip_address = None + self.private_ip_address = None + self.vpn_user_name = None + self.max_bandwidth = None + self.egress_packets_transferred = None + self.egress_bytes_transferred = None + self.ingress_packets_transferred = None + self.ingress_bytes_transferred = None + self.max_packets_per_second = None + + +class VpnClientConnectionHealthDetailListResult(msrest.serialization.Model): + """List of virtual network gateway vpn client connection health. + + :param value: List of vpn client connection health. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnClientConnectionHealthDetail] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnClientConnectionHealthDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientConnectionHealthDetailListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VpnClientIPsecParameters(msrest.serialization.Model): + """An IPSec parameters for a virtual network gateway P2S connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) lifetime in seconds for P2S client. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) payload size in KB for P2S client.. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE phase 1). Possible + values include: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", + "GCMAES256". + :type ipsec_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase 1). Possible values + include: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", "GCMAES256". + :type ipsec_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase 2). Possible values + include: "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", "GCMAES128". + :type ike_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). Possible values + include: "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", "GCMAES128". + :type ike_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IkeIntegrity + :param dh_group: Required. The DH Group used in IKE Phase 1 for initial SA. Possible values + include: "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", + "DHGroup24". + :type dh_group: str or ~azure.mgmt.network.v2020_07_01.models.DhGroup + :param pfs_group: Required. The Pfs Group used in IKE Phase 2 for new child SA. Possible values + include: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", "PFSMM". + :type pfs_group: str or ~azure.mgmt.network.v2020_07_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientIPsecParameters, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs['sa_life_time_seconds'] + self.sa_data_size_kilobytes = kwargs['sa_data_size_kilobytes'] + self.ipsec_encryption = kwargs['ipsec_encryption'] + self.ipsec_integrity = kwargs['ipsec_integrity'] + self.ike_encryption = kwargs['ike_encryption'] + self.ike_integrity = kwargs['ike_integrity'] + self.dh_group = kwargs['dh_group'] + self.pfs_group = kwargs['pfs_group'] + + +class VpnClientParameters(msrest.serialization.Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible values include: + "Amd64", "X86". + :type processor_architecture: str or + ~azure.mgmt.network.v2020_07_01.models.ProcessorArchitecture + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_07_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the radius server + authentication certificate as a Base-64 encoded string. Required only if external radius + authentication has been configured with EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public certificate data + encoded as Base-64 strings. Optional parameter for external radius based authentication with + EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked certificate + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.thumbprint = kwargs.get('thumbprint', None) + self.provisioning_state = None + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.public_cert_data = kwargs['public_cert_data'] + self.provisioning_state = None + + +class VpnConnection(SubResource): + """VpnConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param remote_vpn_site: Id of the connected vpn site. + :type remote_vpn_site: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param routing_weight: Routing weight for vpn connection. + :type routing_weight: int + :param dpd_timeout_seconds: DPD timeout in seconds for vpn connection. + :type dpd_timeout_seconds: int + :ivar connection_status: The connection status. Possible values include: "Unknown", + "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or ~azure.mgmt.network.v2020_07_01.models.VpnConnectionStatus + :param vpn_connection_protocol_type: Connection protocol used for this connection. Possible + values include: "IKEv2", "IKEv1". + :type vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar ingress_bytes_transferred: Ingress bytes transferred. + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: Egress bytes transferred. + :vartype egress_bytes_transferred: long + :param connection_bandwidth: Expected bandwidth in MBPS. + :type connection_bandwidth: int + :param shared_key: SharedKey for the vpn connection. + :type shared_key: str + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param enable_rate_limiting: EnableBgp flag. + :type enable_rate_limiting: bool + :param enable_internet_security: Enable internet security. + :type enable_internet_security: bool + :param use_local_azure_ip_address: Use local azure ip to initiate connection. + :type use_local_azure_ip_address: bool + :ivar provisioning_state: The provisioning state of the VPN connection resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param vpn_link_connections: List of all vpn site link connections to the gateway. + :type vpn_link_connections: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLinkConnection] + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + """ + + _validation = { + 'etag': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'remote_vpn_site': {'key': 'properties.remoteVpnSite', 'type': 'SubResource'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'dpd_timeout_seconds': {'key': 'properties.dpdTimeoutSeconds', 'type': 'int'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'vpn_connection_protocol_type': {'key': 'properties.vpnConnectionProtocolType', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'connection_bandwidth': {'key': 'properties.connectionBandwidth', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'enable_rate_limiting': {'key': 'properties.enableRateLimiting', 'type': 'bool'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'use_local_azure_ip_address': {'key': 'properties.useLocalAzureIpAddress', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vpn_link_connections': {'key': 'properties.vpnLinkConnections', 'type': '[VpnSiteLinkConnection]'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.remote_vpn_site = kwargs.get('remote_vpn_site', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.dpd_timeout_seconds = kwargs.get('dpd_timeout_seconds', None) + self.connection_status = None + self.vpn_connection_protocol_type = kwargs.get('vpn_connection_protocol_type', None) + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.connection_bandwidth = kwargs.get('connection_bandwidth', None) + self.shared_key = kwargs.get('shared_key', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.enable_rate_limiting = kwargs.get('enable_rate_limiting', None) + self.enable_internet_security = kwargs.get('enable_internet_security', None) + self.use_local_azure_ip_address = kwargs.get('use_local_azure_ip_address', None) + self.provisioning_state = None + self.vpn_link_connections = kwargs.get('vpn_link_connections', None) + self.routing_configuration = kwargs.get('routing_configuration', None) + + +class VpnConnectionPacketCaptureStartParameters(msrest.serialization.Model): + """Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. + + :param filter_data: Start Packet capture parameters on vpn connection. + :type filter_data: str + :param link_connection_names: List of site link connection names. + :type link_connection_names: list[str] + """ + + _attribute_map = { + 'filter_data': {'key': 'filterData', 'type': 'str'}, + 'link_connection_names': {'key': 'linkConnectionNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnConnectionPacketCaptureStartParameters, self).__init__(**kwargs) + self.filter_data = kwargs.get('filter_data', None) + self.link_connection_names = kwargs.get('link_connection_names', None) + + +class VpnConnectionPacketCaptureStopParameters(msrest.serialization.Model): + """Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + + :param sas_url: SAS url for packet capture on vpn connection. + :type sas_url: str + :param link_connection_names: List of site link connection names. + :type link_connection_names: list[str] + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'link_connection_names': {'key': 'linkConnectionNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnConnectionPacketCaptureStopParameters, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + self.link_connection_names = kwargs.get('link_connection_names', None) + + +class VpnDeviceScriptParameters(msrest.serialization.Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = kwargs.get('vendor', None) + self.device_family = kwargs.get('device_family', None) + self.firmware_version = kwargs.get('firmware_version', None) + + +class VpnGateway(Resource): + """VpnGateway Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_hub: The VirtualHub to which the gateway belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param connections: List of all vpn connections to the gateway. + :type connections: list[~azure.mgmt.network.v2020_07_01.models.VpnConnection] + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :ivar provisioning_state: The provisioning state of the VPN gateway resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param vpn_gateway_scale_unit: The scale unit for this vpn gateway. + :type vpn_gateway_scale_unit: int + :ivar ip_configurations: List of all IPs configured on the gateway. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.VpnGatewayIpConfiguration] + :param is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the VpnGateway. + :type is_routing_preference_internet: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'connections': {'key': 'properties.connections', 'type': '[VpnConnection]'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vpn_gateway_scale_unit': {'key': 'properties.vpnGatewayScaleUnit', 'type': 'int'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VpnGatewayIpConfiguration]'}, + 'is_routing_preference_internet': {'key': 'properties.isRoutingPreferenceInternet', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnGateway, self).__init__(**kwargs) + self.etag = None + self.virtual_hub = kwargs.get('virtual_hub', None) + self.connections = kwargs.get('connections', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.provisioning_state = None + self.vpn_gateway_scale_unit = kwargs.get('vpn_gateway_scale_unit', None) + self.ip_configurations = None + self.is_routing_preference_internet = kwargs.get('is_routing_preference_internet', None) + + +class VpnGatewayIpConfiguration(msrest.serialization.Model): + """IP Configuration of a VPN Gateway Resource. + + :param id: The identifier of the IP configuration for a VPN Gateway. + :type id: str + :param public_ip_address: The public IP address of this IP configuration. + :type public_ip_address: str + :param private_ip_address: The private IP address of this IP configuration. + :type private_ip_address: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnGatewayIpConfiguration, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + + +class VpnGatewayPacketCaptureStartParameters(msrest.serialization.Model): + """Start packet capture parameters. + + :param filter_data: Start Packet capture parameters on vpn gateway. + :type filter_data: str + """ + + _attribute_map = { + 'filter_data': {'key': 'filterData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnGatewayPacketCaptureStartParameters, self).__init__(**kwargs) + self.filter_data = kwargs.get('filter_data', None) + + +class VpnGatewayPacketCaptureStopParameters(msrest.serialization.Model): + """Stop packet capture parameters. + + :param sas_url: SAS url for packet capture on vpn gateway. + :type sas_url: str + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnGatewayPacketCaptureStopParameters, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + + +class VpnLinkBgpSettings(msrest.serialization.Model): + """BGP settings details for a link. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :type bgp_peering_address: str + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnLinkBgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + + +class VpnLinkProviderProperties(msrest.serialization.Model): + """List of properties of a link provider. + + :param link_provider_name: Name of the link provider. + :type link_provider_name: str + :param link_speed_in_mbps: Link speed. + :type link_speed_in_mbps: int + """ + + _attribute_map = { + 'link_provider_name': {'key': 'linkProviderName', 'type': 'str'}, + 'link_speed_in_mbps': {'key': 'linkSpeedInMbps', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnLinkProviderProperties, self).__init__(**kwargs) + self.link_provider_name = kwargs.get('link_provider_name', None) + self.link_speed_in_mbps = kwargs.get('link_speed_in_mbps', None) + + +class VpnPacketCaptureStartParameters(msrest.serialization.Model): + """Start packet capture parameters on virtual network gateway. + + :param filter_data: Start Packet capture parameters. + :type filter_data: str + """ + + _attribute_map = { + 'filter_data': {'key': 'filterData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnPacketCaptureStartParameters, self).__init__(**kwargs) + self.filter_data = kwargs.get('filter_data', None) + + +class VpnPacketCaptureStopParameters(msrest.serialization.Model): + """Stop packet capture parameters. + + :param sas_url: SAS url for packet capture on virtual network gateway. + :type sas_url: str + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnPacketCaptureStopParameters, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + + +class VpnProfileResponse(msrest.serialization.Model): + """Vpn Profile Response for package generation. + + :param profile_url: URL to the VPN profile. + :type profile_url: str + """ + + _attribute_map = { + 'profile_url': {'key': 'profileUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnProfileResponse, self).__init__(**kwargs) + self.profile_url = kwargs.get('profile_url', None) + + +class VpnServerConfigRadiusClientRootCertificate(msrest.serialization.Model): + """Properties of the Radius client root certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param thumbprint: The Radius client root certificate thumbprint. + :type thumbprint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnServerConfigRadiusClientRootCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.thumbprint = kwargs.get('thumbprint', None) + + +class VpnServerConfigRadiusServerRootCertificate(msrest.serialization.Model): + """Properties of Radius Server root certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param public_cert_data: The certificate public data. + :type public_cert_data: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_cert_data': {'key': 'publicCertData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnServerConfigRadiusServerRootCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + + +class VpnServerConfiguration(Resource): + """VpnServerConfiguration Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param name_properties_name: The name of the VpnServerConfiguration that is unique within a + resource group. + :type name_properties_name: str + :param vpn_protocols: VPN protocols for the VpnServerConfiguration. + :type vpn_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.VpnGatewayTunnelingProtocol] + :param vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :type vpn_authentication_types: list[str or + ~azure.mgmt.network.v2020_07_01.models.VpnAuthenticationType] + :param vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigVpnClientRootCertificate] + :param vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigVpnClientRevokedCertificate] + :param radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :type radius_server_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigRadiusServerRootCertificate] + :param radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :type radius_client_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigRadiusClientRootCertificate] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param radius_server_address: The radius server address property of the VpnServerConfiguration + resource for point to site client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the VpnServerConfiguration resource + for point to site client connection. + :type radius_server_secret: str + :param radius_servers: Multiple Radius Server configuration for VpnServerConfiguration. + :type radius_servers: list[~azure.mgmt.network.v2020_07_01.models.RadiusServer] + :param aad_authentication_parameters: The set of aad vpn authentication parameters. + :type aad_authentication_parameters: + ~azure.mgmt.network.v2020_07_01.models.AadAuthenticationParameters + :ivar provisioning_state: The provisioning state of the VpnServerConfiguration resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar p2_s_vpn_gateways: List of references to P2SVpnGateways. + :vartype p2_s_vpn_gateways: list[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :ivar etag_properties_etag: A unique read-only string that changes whenever the resource is + updated. + :vartype etag_properties_etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'p2_s_vpn_gateways': {'readonly': True}, + 'etag_properties_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'vpn_protocols': {'key': 'properties.vpnProtocols', 'type': '[str]'}, + 'vpn_authentication_types': {'key': 'properties.vpnAuthenticationTypes', 'type': '[str]'}, + 'vpn_client_root_certificates': {'key': 'properties.vpnClientRootCertificates', 'type': '[VpnServerConfigVpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'properties.vpnClientRevokedCertificates', 'type': '[VpnServerConfigVpnClientRevokedCertificate]'}, + 'radius_server_root_certificates': {'key': 'properties.radiusServerRootCertificates', 'type': '[VpnServerConfigRadiusServerRootCertificate]'}, + 'radius_client_root_certificates': {'key': 'properties.radiusClientRootCertificates', 'type': '[VpnServerConfigRadiusClientRootCertificate]'}, + 'vpn_client_ipsec_policies': {'key': 'properties.vpnClientIpsecPolicies', 'type': '[IpsecPolicy]'}, + 'radius_server_address': {'key': 'properties.radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'properties.radiusServerSecret', 'type': 'str'}, + 'radius_servers': {'key': 'properties.radiusServers', 'type': '[RadiusServer]'}, + 'aad_authentication_parameters': {'key': 'properties.aadAuthenticationParameters', 'type': 'AadAuthenticationParameters'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'p2_s_vpn_gateways': {'key': 'properties.p2SVpnGateways', 'type': '[P2SVpnGateway]'}, + 'etag_properties_etag': {'key': 'properties.etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnServerConfiguration, self).__init__(**kwargs) + self.etag = None + self.name_properties_name = kwargs.get('name_properties_name', None) + self.vpn_protocols = kwargs.get('vpn_protocols', None) + self.vpn_authentication_types = kwargs.get('vpn_authentication_types', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.radius_server_root_certificates = kwargs.get('radius_server_root_certificates', None) + self.radius_client_root_certificates = kwargs.get('radius_client_root_certificates', None) + self.vpn_client_ipsec_policies = kwargs.get('vpn_client_ipsec_policies', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) + self.radius_servers = kwargs.get('radius_servers', None) + self.aad_authentication_parameters = kwargs.get('aad_authentication_parameters', None) + self.provisioning_state = None + self.p2_s_vpn_gateways = None + self.etag_properties_etag = None + + +class VpnServerConfigurationsResponse(msrest.serialization.Model): + """VpnServerConfigurations list associated with VirtualWan Response. + + :param vpn_server_configuration_resource_ids: List of VpnServerConfigurations associated with + VirtualWan. + :type vpn_server_configuration_resource_ids: list[str] + """ + + _attribute_map = { + 'vpn_server_configuration_resource_ids': {'key': 'vpnServerConfigurationResourceIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnServerConfigurationsResponse, self).__init__(**kwargs) + self.vpn_server_configuration_resource_ids = kwargs.get('vpn_server_configuration_resource_ids', None) + + +class VpnServerConfigVpnClientRevokedCertificate(msrest.serialization.Model): + """Properties of the revoked VPN client certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnServerConfigVpnClientRevokedCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.thumbprint = kwargs.get('thumbprint', None) + + +class VpnServerConfigVpnClientRootCertificate(msrest.serialization.Model): + """Properties of VPN client root certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param public_cert_data: The certificate public data. + :type public_cert_data: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_cert_data': {'key': 'publicCertData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnServerConfigVpnClientRootCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + + +class VpnSite(Resource): + """VpnSite Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_wan: The VirtualWAN to which the vpnSite belongs. + :type virtual_wan: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param device_properties: The device properties. + :type device_properties: ~azure.mgmt.network.v2020_07_01.models.DeviceProperties + :param ip_address: The ip-address for the vpn-site. + :type ip_address: str + :param site_key: The key for vpn-site that can be used for connections. + :type site_key: str + :param address_space: The AddressSpace that contains an array of IP address ranges. + :type address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :ivar provisioning_state: The provisioning state of the VPN site resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param is_security_site: IsSecuritySite flag. + :type is_security_site: bool + :param vpn_site_links: List of all vpn site links. + :type vpn_site_links: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLink] + :param o365_policy: Office365 Policy. + :type o365_policy: ~azure.mgmt.network.v2020_07_01.models.O365PolicyProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_wan': {'key': 'properties.virtualWan', 'type': 'SubResource'}, + 'device_properties': {'key': 'properties.deviceProperties', 'type': 'DeviceProperties'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'site_key': {'key': 'properties.siteKey', 'type': 'str'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'bgp_properties': {'key': 'properties.bgpProperties', 'type': 'BgpSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_security_site': {'key': 'properties.isSecuritySite', 'type': 'bool'}, + 'vpn_site_links': {'key': 'properties.vpnSiteLinks', 'type': '[VpnSiteLink]'}, + 'o365_policy': {'key': 'properties.o365Policy', 'type': 'O365PolicyProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnSite, self).__init__(**kwargs) + self.etag = None + self.virtual_wan = kwargs.get('virtual_wan', None) + self.device_properties = kwargs.get('device_properties', None) + self.ip_address = kwargs.get('ip_address', None) + self.site_key = kwargs.get('site_key', None) + self.address_space = kwargs.get('address_space', None) + self.bgp_properties = kwargs.get('bgp_properties', None) + self.provisioning_state = None + self.is_security_site = kwargs.get('is_security_site', None) + self.vpn_site_links = kwargs.get('vpn_site_links', None) + self.o365_policy = kwargs.get('o365_policy', None) + + +class VpnSiteId(msrest.serialization.Model): + """VpnSite Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vpn_site: The resource-uri of the vpn-site for which config is to be fetched. + :vartype vpn_site: str + """ + + _validation = { + 'vpn_site': {'readonly': True}, + } + + _attribute_map = { + 'vpn_site': {'key': 'vpnSite', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnSiteId, self).__init__(**kwargs) + self.vpn_site = None + + +class VpnSiteLink(SubResource): + """VpnSiteLink Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar type: Resource type. + :vartype type: str + :param link_properties: The link provider properties. + :type link_properties: ~azure.mgmt.network.v2020_07_01.models.VpnLinkProviderProperties + :param ip_address: The ip-address for the vpn-site-link. + :type ip_address: str + :param fqdn: FQDN of vpn-site-link. + :type fqdn: str + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_07_01.models.VpnLinkBgpSettings + :ivar provisioning_state: The provisioning state of the VPN site link resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'link_properties': {'key': 'properties.linkProperties', 'type': 'VpnLinkProviderProperties'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'bgp_properties': {'key': 'properties.bgpProperties', 'type': 'VpnLinkBgpSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnSiteLink, self).__init__(**kwargs) + self.etag = None + self.name = kwargs.get('name', None) + self.type = None + self.link_properties = kwargs.get('link_properties', None) + self.ip_address = kwargs.get('ip_address', None) + self.fqdn = kwargs.get('fqdn', None) + self.bgp_properties = kwargs.get('bgp_properties', None) + self.provisioning_state = None + + +class VpnSiteLinkConnection(SubResource): + """VpnSiteLinkConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param vpn_site_link: Id of the connected vpn site link. + :type vpn_site_link: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param routing_weight: Routing weight for vpn connection. + :type routing_weight: int + :ivar connection_status: The connection status. Possible values include: "Unknown", + "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or ~azure.mgmt.network.v2020_07_01.models.VpnConnectionStatus + :param vpn_connection_protocol_type: Connection protocol used for this connection. Possible + values include: "IKEv2", "IKEv1". + :type vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar ingress_bytes_transferred: Ingress bytes transferred. + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: Egress bytes transferred. + :vartype egress_bytes_transferred: long + :param connection_bandwidth: Expected bandwidth in MBPS. + :type connection_bandwidth: int + :param shared_key: SharedKey for the vpn connection. + :type shared_key: str + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param enable_rate_limiting: EnableBgp flag. + :type enable_rate_limiting: bool + :param use_local_azure_ip_address: Use local azure ip to initiate connection. + :type use_local_azure_ip_address: bool + :ivar provisioning_state: The provisioning state of the VPN site link connection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vpn_site_link': {'key': 'properties.vpnSiteLink', 'type': 'SubResource'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'vpn_connection_protocol_type': {'key': 'properties.vpnConnectionProtocolType', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'connection_bandwidth': {'key': 'properties.connectionBandwidth', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'enable_rate_limiting': {'key': 'properties.enableRateLimiting', 'type': 'bool'}, + 'use_local_azure_ip_address': {'key': 'properties.useLocalAzureIpAddress', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnSiteLinkConnection, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.type = None + self.vpn_site_link = kwargs.get('vpn_site_link', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.connection_status = None + self.vpn_connection_protocol_type = kwargs.get('vpn_connection_protocol_type', None) + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.connection_bandwidth = kwargs.get('connection_bandwidth', None) + self.shared_key = kwargs.get('shared_key', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.enable_rate_limiting = kwargs.get('enable_rate_limiting', None) + self.use_local_azure_ip_address = kwargs.get('use_local_azure_ip_address', None) + self.provisioning_state = None + + +class WebApplicationFirewallCustomRule(msrest.serialization.Model): + """Defines contents of a web application rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: The name of the resource that is unique within a policy. This name can be used to + access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Required. Priority of the rule. Rules with a lower value will be evaluated + before rules with a higher value. + :type priority: int + :param rule_type: Required. The rule type. Possible values include: "MatchRule", "Invalid". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallRuleType + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.network.v2020_07_01.models.MatchCondition] + :param action: Required. Type of Actions. Possible values include: "Allow", "Block", "Log". + :type action: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallAction + """ + + _validation = { + 'name': {'max_length': 128, 'min_length': 0}, + 'etag': {'readonly': True}, + 'priority': {'required': True}, + 'rule_type': {'required': True}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebApplicationFirewallCustomRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.etag = None + self.priority = kwargs['priority'] + self.rule_type = kwargs['rule_type'] + self.match_conditions = kwargs['match_conditions'] + self.action = kwargs['action'] + + +class WebApplicationFirewallPolicy(Resource): + """Defines web application firewall policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param policy_settings: The PolicySettings for policy. + :type policy_settings: ~azure.mgmt.network.v2020_07_01.models.PolicySettings + :param custom_rules: The custom rules inside the policy. + :type custom_rules: + list[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGateway] + :ivar provisioning_state: The provisioning state of the web application firewall policy + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar resource_state: Resource status of the policy. Possible values include: "Creating", + "Enabling", "Enabled", "Disabling", "Disabled", "Deleting". + :vartype resource_state: str or + ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicyResourceState + :param managed_rules: Describes the managedRules structure. + :type managed_rules: ~azure.mgmt.network.v2020_07_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar path_based_rules: A collection of references to application gateway path rules. + :vartype path_based_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'application_gateways': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_state': {'readonly': True}, + 'http_listeners': {'readonly': True}, + 'path_based_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, + 'custom_rules': {'key': 'properties.customRules', 'type': '[WebApplicationFirewallCustomRule]'}, + 'application_gateways': {'key': 'properties.applicationGateways', 'type': '[ApplicationGateway]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRulesDefinition'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[SubResource]'}, + 'path_based_rules': {'key': 'properties.pathBasedRules', 'type': '[SubResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(WebApplicationFirewallPolicy, self).__init__(**kwargs) + self.etag = None + self.policy_settings = kwargs.get('policy_settings', None) + self.custom_rules = kwargs.get('custom_rules', None) + self.application_gateways = None + self.provisioning_state = None + self.resource_state = None + self.managed_rules = kwargs.get('managed_rules', None) + self.http_listeners = None + self.path_based_rules = None + + +class WebApplicationFirewallPolicyListResult(msrest.serialization.Model): + """Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of WebApplicationFirewallPolicies within a resource group. + :vartype value: list[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy] + :ivar next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are + any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebApplicationFirewallPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebApplicationFirewallPolicyListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_models_py3.py new file mode 100644 index 0000000000000..1ee59ed6d3da0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_models_py3.py @@ -0,0 +1,24971 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._network_management_client_enums import * + + +class AadAuthenticationParameters(msrest.serialization.Model): + """AAD Vpn authentication type related parameters. + + :param aad_tenant: AAD Vpn authentication parameter AAD tenant. + :type aad_tenant: str + :param aad_audience: AAD Vpn authentication parameter AAD audience. + :type aad_audience: str + :param aad_issuer: AAD Vpn authentication parameter AAD issuer. + :type aad_issuer: str + """ + + _attribute_map = { + 'aad_tenant': {'key': 'aadTenant', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + 'aad_issuer': {'key': 'aadIssuer', 'type': 'str'}, + } + + def __init__( + self, + *, + aad_tenant: Optional[str] = None, + aad_audience: Optional[str] = None, + aad_issuer: Optional[str] = None, + **kwargs + ): + super(AadAuthenticationParameters, self).__init__(**kwargs) + self.aad_tenant = aad_tenant + self.aad_audience = aad_audience + self.aad_issuer = aad_issuer + + +class AddressSpace(msrest.serialization.Model): + """AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this virtual network in CIDR + notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__( + self, + *, + address_prefixes: Optional[List[str]] = None, + **kwargs + ): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes + + +class Resource(msrest.serialization.Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting where the resource needs to come from. + :type zones: list[str] + :param identity: The identity of the application gateway, if configured. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway resource. Possible values + include: "Stopped", "Starting", "Running", "Stopping". + :vartype operational_state: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of the application gateway resource. For default + limits, see `Application Gateway limits `_. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type authentication_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAuthenticationCertificate] + :param trusted_root_certificates: Trusted Root certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type trusted_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayTrustedRootCertificate] + :param trusted_client_certificates: Trusted client certificates of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type trusted_client_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayTrustedClientCertificate] + :param ssl_certificates: SSL certificates of the application gateway resource. For default + limits, see `Application Gateway limits `_. + :type ssl_certificates: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the application gateway resource. + For default limits, see `Application Gateway limits `_. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. For default limits, + see `Application Gateway limits `_. + :type frontend_ports: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application gateway resource. For + default limits, see `Application Gateway limits `_. + :type backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the application gateway + resource. For default limits, see `Application Gateway limits + `_. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. For default limits, + see `Application Gateway limits `_. + :type http_listeners: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayHttpListener] + :param ssl_profiles: SSL profiles of the application gateway resource. For default limits, see + `Application Gateway limits `_. + :type ssl_profiles: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProfile] + :param url_path_maps: URL path map of the application gateway resource. For default limits, see + `Application Gateway limits `_. + :type url_path_maps: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRequestRoutingRule] + :param rewrite_rule_sets: Rewrite rules for the application gateway resource. + :type rewrite_rule_sets: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRuleSet] + :param redirect_configurations: Redirect configurations of the application gateway resource. + For default limits, see `Application Gateway limits `_. + :type redirect_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param enable_http2: Whether HTTP2 is enabled on the application gateway resource. + :type enable_http2: bool + :param enable_fips: Whether FIPS is enabled on the application gateway resource. + :type enable_fips: bool + :param autoscale_configuration: Autoscale Configuration. + :type autoscale_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAutoscaleConfiguration + :param private_link_configurations: PrivateLink configurations on application gateway. + :type private_link_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection] + :ivar resource_guid: The resource GUID property of the application gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application gateway resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the application gateway + resource. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCustomError] + :param force_firewall_policy_association: If true, associates a firewall policy with an + application gateway regardless whether the policy differs from the WAF Config. + :type force_firewall_policy_association: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'operational_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'trusted_root_certificates': {'key': 'properties.trustedRootCertificates', 'type': '[ApplicationGatewayTrustedRootCertificate]'}, + 'trusted_client_certificates': {'key': 'properties.trustedClientCertificates', 'type': '[ApplicationGatewayTrustedClientCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'ssl_profiles': {'key': 'properties.sslProfiles', 'type': '[ApplicationGatewaySslProfile]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'rewrite_rule_sets': {'key': 'properties.rewriteRuleSets', 'type': '[ApplicationGatewayRewriteRuleSet]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + 'enable_http2': {'key': 'properties.enableHttp2', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFips', 'type': 'bool'}, + 'autoscale_configuration': {'key': 'properties.autoscaleConfiguration', 'type': 'ApplicationGatewayAutoscaleConfiguration'}, + 'private_link_configurations': {'key': 'properties.privateLinkConfigurations', 'type': '[ApplicationGatewayPrivateLinkConfiguration]'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ApplicationGatewayPrivateEndpointConnection]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'custom_error_configurations': {'key': 'properties.customErrorConfigurations', 'type': '[ApplicationGatewayCustomError]'}, + 'force_firewall_policy_association': {'key': 'properties.forceFirewallPolicyAssociation', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + sku: Optional["ApplicationGatewaySku"] = None, + ssl_policy: Optional["ApplicationGatewaySslPolicy"] = None, + gateway_ip_configurations: Optional[List["ApplicationGatewayIPConfiguration"]] = None, + authentication_certificates: Optional[List["ApplicationGatewayAuthenticationCertificate"]] = None, + trusted_root_certificates: Optional[List["ApplicationGatewayTrustedRootCertificate"]] = None, + trusted_client_certificates: Optional[List["ApplicationGatewayTrustedClientCertificate"]] = None, + ssl_certificates: Optional[List["ApplicationGatewaySslCertificate"]] = None, + frontend_ip_configurations: Optional[List["ApplicationGatewayFrontendIPConfiguration"]] = None, + frontend_ports: Optional[List["ApplicationGatewayFrontendPort"]] = None, + probes: Optional[List["ApplicationGatewayProbe"]] = None, + backend_address_pools: Optional[List["ApplicationGatewayBackendAddressPool"]] = None, + backend_http_settings_collection: Optional[List["ApplicationGatewayBackendHttpSettings"]] = None, + http_listeners: Optional[List["ApplicationGatewayHttpListener"]] = None, + ssl_profiles: Optional[List["ApplicationGatewaySslProfile"]] = None, + url_path_maps: Optional[List["ApplicationGatewayUrlPathMap"]] = None, + request_routing_rules: Optional[List["ApplicationGatewayRequestRoutingRule"]] = None, + rewrite_rule_sets: Optional[List["ApplicationGatewayRewriteRuleSet"]] = None, + redirect_configurations: Optional[List["ApplicationGatewayRedirectConfiguration"]] = None, + web_application_firewall_configuration: Optional["ApplicationGatewayWebApplicationFirewallConfiguration"] = None, + firewall_policy: Optional["SubResource"] = None, + enable_http2: Optional[bool] = None, + enable_fips: Optional[bool] = None, + autoscale_configuration: Optional["ApplicationGatewayAutoscaleConfiguration"] = None, + private_link_configurations: Optional[List["ApplicationGatewayPrivateLinkConfiguration"]] = None, + custom_error_configurations: Optional[List["ApplicationGatewayCustomError"]] = None, + force_firewall_policy_association: Optional[bool] = None, + **kwargs + ): + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.zones = zones + self.identity = identity + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.trusted_root_certificates = trusted_root_certificates + self.trusted_client_certificates = trusted_client_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.ssl_profiles = ssl_profiles + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.rewrite_rule_sets = rewrite_rule_sets + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.firewall_policy = firewall_policy + self.enable_http2 = enable_http2 + self.enable_fips = enable_fips + self.autoscale_configuration = autoscale_configuration + self.private_link_configurations = private_link_configurations + self.private_endpoint_connections = None + self.resource_guid = None + self.provisioning_state = None + self.custom_error_configurations = custom_error_configurations + self.force_firewall_policy_association = force_firewall_policy_association + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = id + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the authentication certificate that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Certificate public data. + :type data: str + :ivar provisioning_state: The provisioning state of the authentication certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + data: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.provisioning_state = None + + +class ApplicationGatewayAutoscaleConfiguration(msrest.serialization.Model): + """Application Gateway autoscale configuration. + + All required parameters must be populated in order to send to Azure. + + :param min_capacity: Required. Lower bound on number of Application Gateway capacity. + :type min_capacity: int + :param max_capacity: Upper bound on number of Application Gateway capacity. + :type max_capacity: int + """ + + _validation = { + 'min_capacity': {'required': True, 'minimum': 0}, + 'max_capacity': {'minimum': 2}, + } + + _attribute_map = { + 'min_capacity': {'key': 'minCapacity', 'type': 'int'}, + 'max_capacity': {'key': 'maxCapacity', 'type': 'int'}, + } + + def __init__( + self, + *, + min_capacity: int, + max_capacity: Optional[int] = None, + **kwargs + ): + super(ApplicationGatewayAutoscaleConfiguration, self).__init__(**kwargs) + self.min_capacity = min_capacity + self.max_capacity = max_capacity + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by default to application + gateway. Possible values include: "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", + "AppGwSslPolicy20170401S". + :type default_policy: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + predefined_policies: Optional[List["SubResource"]] = None, + default_policy: Optional[Union[str, "ApplicationGatewaySslPolicyName"]] = None, + available_cipher_suites: Optional[List[Union[str, "ApplicationGatewaySslCipherSuite"]]] = None, + available_protocols: Optional[List[Union[str, "ApplicationGatewaySslProtocol"]]] = None, + **kwargs + ): + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols + + +class ApplicationGatewayAvailableSslPredefinedPolicies(msrest.serialization.Model): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + :param value: List of available Ssl predefined policy. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPredefinedPolicy] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewaySslPredefinedPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ApplicationGatewaySslPredefinedPolicy"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayAvailableSslPredefinedPolicies, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayAvailableWafRuleSetsResult(msrest.serialization.Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__( + self, + *, + value: Optional[List["ApplicationGatewayFirewallRuleSet"]] = None, + **kwargs + ): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value + + +class ApplicationGatewayBackendAddress(msrest.serialization.Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address. + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + fqdn: Optional[str] = None, + ip_address: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the backend address pool that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar backend_ip_configurations: Collection of references to IPs defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses. + :type backend_addresses: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddress] + :ivar provisioning_state: The provisioning state of the backend address pool resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'backend_ip_configurations': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + backend_addresses: Optional[List["ApplicationGatewayBackendAddress"]] = None, + **kwargs + ): + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.backend_ip_configurations = None + self.backend_addresses = backend_addresses + self.provisioning_state = None + + +class ApplicationGatewayBackendHealth(msrest.serialization.Model): + """Response for ApplicationGatewayBackendHealth API service call. + + :param backend_address_pools: A list of ApplicationGatewayBackendHealthPool resources. + :type backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__( + self, + *, + backend_address_pools: Optional[List["ApplicationGatewayBackendHealthPool"]] = None, + **kwargs + ): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools + + +class ApplicationGatewayBackendHealthHttpSettings(msrest.serialization.Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference to an ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__( + self, + *, + backend_http_settings: Optional["ApplicationGatewayBackendHttpSettings"] = None, + servers: Optional[List["ApplicationGatewayBackendHealthServer"]] = None, + **kwargs + ): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers + + +class ApplicationGatewayBackendHealthOnDemand(msrest.serialization.Model): + """Result of on demand test probe. + + :param backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthHttpSettings + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_health_http_settings': {'key': 'backendHealthHttpSettings', 'type': 'ApplicationGatewayBackendHealthHttpSettings'}, + } + + def __init__( + self, + *, + backend_address_pool: Optional["ApplicationGatewayBackendAddressPool"] = None, + backend_health_http_settings: Optional["ApplicationGatewayBackendHealthHttpSettings"] = None, + **kwargs + ): + super(ApplicationGatewayBackendHealthOnDemand, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_health_http_settings = backend_health_http_settings + + +class ApplicationGatewayBackendHealthPool(msrest.serialization.Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference to an ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__( + self, + *, + backend_address_pool: Optional["ApplicationGatewayBackendAddressPool"] = None, + backend_http_settings_collection: Optional[List["ApplicationGatewayBackendHealthHttpSettings"]] = None, + **kwargs + ): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection + + +class ApplicationGatewayBackendHealthServer(msrest.serialization.Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference to IP configuration of backend server. + :type ip_configuration: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: "Unknown", "Up", "Down", + "Partial", "Draining". + :type health: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthServerHealth + :param health_probe_log: Health Probe Log. + :type health_probe_log: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + 'health_probe_log': {'key': 'healthProbeLog', 'type': 'str'}, + } + + def __init__( + self, + *, + address: Optional[str] = None, + ip_configuration: Optional["NetworkInterfaceIPConfiguration"] = None, + health: Optional[Union[str, "ApplicationGatewayBackendHealthServerHealth"]] = None, + health_probe_log: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health + self.health_probe_log = health_probe_log + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the backend http settings that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param port: The destination port on the backend. + :type port: int + :param protocol: The protocol used to communicate with the backend. Possible values include: + "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values include: "Enabled", + "Disabled". + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway will fail the request + if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 + seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param authentication_certificates: Array of references to application gateway authentication + certificates. + :type authentication_certificates: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param trusted_root_certificates: Array of references to application gateway trusted root + certificates. + :type trusted_root_certificates: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param connection_draining: Connection draining of the backend http settings resource. + :type connection_draining: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header should be picked from + the host name of the backend server. Default value is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. Null means no path + will be prefixed. Default value is null. + :type path: str + :ivar provisioning_state: The provisioning state of the backend HTTP settings resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'trusted_root_certificates': {'key': 'properties.trustedRootCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, + cookie_based_affinity: Optional[Union[str, "ApplicationGatewayCookieBasedAffinity"]] = None, + request_timeout: Optional[int] = None, + probe: Optional["SubResource"] = None, + authentication_certificates: Optional[List["SubResource"]] = None, + trusted_root_certificates: Optional[List["SubResource"]] = None, + connection_draining: Optional["ApplicationGatewayConnectionDraining"] = None, + host_name: Optional[str] = None, + pick_host_name_from_backend_address: Optional[bool] = None, + affinity_cookie_name: Optional[str] = None, + probe_enabled: Optional[bool] = None, + path: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.trusted_root_certificates = trusted_root_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = None + + +class ApplicationGatewayClientAuthConfiguration(msrest.serialization.Model): + """Application gateway client authentication configuration. + + :param verify_client_cert_issuer_dn: Verify client certificate issuer name on the application + gateway. + :type verify_client_cert_issuer_dn: bool + """ + + _attribute_map = { + 'verify_client_cert_issuer_dn': {'key': 'verifyClientCertIssuerDN', 'type': 'bool'}, + } + + def __init__( + self, + *, + verify_client_cert_issuer_dn: Optional[bool] = None, + **kwargs + ): + super(ApplicationGatewayClientAuthConfiguration, self).__init__(**kwargs) + self.verify_client_cert_issuer_dn = verify_client_cert_issuer_dn + + +class ApplicationGatewayConnectionDraining(msrest.serialization.Model): + """Connection draining allows open connections to a backend server to be active for a specified time after the backend server got removed from the configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection draining is active. + Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: bool, + drain_timeout_in_sec: int, + **kwargs + ): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec + + +class ApplicationGatewayCustomError(msrest.serialization.Model): + """Customer error of an application gateway. + + :param status_code: Status code of the application gateway customer error. Possible values + include: "HttpStatus403", "HttpStatus502". + :type status_code: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCustomErrorStatusCode + :param custom_error_page_url: Error page URL of the application gateway customer error. + :type custom_error_page_url: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'custom_error_page_url': {'key': 'customErrorPageUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + status_code: Optional[Union[str, "ApplicationGatewayCustomErrorStatusCode"]] = None, + custom_error_page_url: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayCustomError, self).__init__(**kwargs) + self.status_code = status_code + self.custom_error_page_url = custom_error_page_url + + +class ApplicationGatewayFirewallDisabledRuleGroup(msrest.serialization.Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules of the rule group + will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__( + self, + *, + rule_group_name: str, + rules: Optional[List[int]] = None, + **kwargs + ): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules + + +class ApplicationGatewayFirewallExclusion(msrest.serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. The variable to be excluded. + :type match_variable: str + :param selector_match_operator: Required. When matchVariable is a collection, operate on the + selector to specify which elements in the collection this exclusion applies to. + :type selector_match_operator: str + :param selector: Required. When matchVariable is a collection, operator used to specify which + elements in the collection this exclusion applies to. + :type selector: str + """ + + _validation = { + 'match_variable': {'required': True}, + 'selector_match_operator': {'required': True}, + 'selector': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector_match_operator': {'key': 'selectorMatchOperator', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__( + self, + *, + match_variable: str, + selector_match_operator: str, + selector: str, + **kwargs + ): + super(ApplicationGatewayFirewallExclusion, self).__init__(**kwargs) + self.match_variable = match_variable + self.selector_match_operator = selector_match_operator + self.selector = selector + + +class ApplicationGatewayFirewallRule(msrest.serialization.Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + rule_id: int, + description: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description + + +class ApplicationGatewayFirewallRuleGroup(msrest.serialization.Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule group. + :type description: str + :param rules: Required. The rules of the web application firewall rule group. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__( + self, + *, + rule_group_name: str, + rules: List["ApplicationGatewayFirewallRule"], + description: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the web application firewall rule set. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param rule_set_type: The type of the web application firewall rule set. + :type rule_set_type: str + :param rule_set_version: The version of the web application firewall rule set type. + :type rule_set_version: str + :param rule_groups: The rule groups of the web application firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + rule_set_type: Optional[str] = None, + rule_set_version: Optional[str] = None, + rule_groups: Optional[List["ApplicationGatewayFirewallRuleGroup"]] = None, + **kwargs + ): + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the frontend IP configuration that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param private_ip_address: PrivateIPAddress of the network interface IP Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param private_link_configuration: Reference to the application gateway private link + configuration. + :type private_link_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the frontend IP configuration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'private_link_configuration': {'key': 'properties.privateLinkConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + subnet: Optional["SubResource"] = None, + public_ip_address: Optional["SubResource"] = None, + private_link_configuration: Optional["SubResource"] = None, + **kwargs + ): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.private_link_configuration = private_link_configuration + self.provisioning_state = None + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the frontend port that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param port: Frontend port. + :type port: int + :ivar provisioning_state: The provisioning state of the frontend port resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + port: Optional[int] = None, + **kwargs + ): + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.port = port + self.provisioning_state = None + + +class ApplicationGatewayHeaderConfiguration(msrest.serialization.Model): + """Header configuration of the Actions set in Application Gateway. + + :param header_name: Header name of the header configuration. + :type header_name: str + :param header_value: Header value of the header configuration. + :type header_value: str + """ + + _attribute_map = { + 'header_name': {'key': 'headerName', 'type': 'str'}, + 'header_value': {'key': 'headerValue', 'type': 'str'}, + } + + def __init__( + self, + *, + header_name: Optional[str] = None, + header_value: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayHeaderConfiguration, self).__init__(**kwargs) + self.header_name = header_name + self.header_value = header_value + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the HTTP listener that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: Frontend IP configuration resource of an application gateway. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protocol: Protocol of the HTTP listener. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application gateway. + :type ssl_certificate: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param ssl_profile: SSL profile resource of the application gateway. + :type ssl_profile: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is https. Enables SNI for + multi-hosting. + :type require_server_name_indication: bool + :ivar provisioning_state: The provisioning state of the HTTP listener resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the HTTP listener. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayCustomError] + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param host_names: List of Host names for HTTP Listener that allows special wildcard characters + as well. + :type host_names: list[str] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'ssl_profile': {'key': 'properties.sslProfile', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'custom_error_configurations': {'key': 'properties.customErrorConfigurations', 'type': '[ApplicationGatewayCustomError]'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + frontend_ip_configuration: Optional["SubResource"] = None, + frontend_port: Optional["SubResource"] = None, + protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, + host_name: Optional[str] = None, + ssl_certificate: Optional["SubResource"] = None, + ssl_profile: Optional["SubResource"] = None, + require_server_name_indication: Optional[bool] = None, + custom_error_configurations: Optional[List["ApplicationGatewayCustomError"]] = None, + firewall_policy: Optional["SubResource"] = None, + host_names: Optional[List[str]] = None, + **kwargs + ): + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.ssl_profile = ssl_profile + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = None + self.custom_error_configurations = custom_error_configurations + self.firewall_policy = firewall_policy + self.host_names = host_names + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the IP configuration that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param subnet: Reference to the subnet resource. A subnet from where application gateway gets + its private address. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the application gateway IP configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + subnet: Optional["SubResource"] = None, + **kwargs + ): + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.subnet = subnet + self.provisioning_state = None + + +class ApplicationGatewayListResult(msrest.serialization.Model): + """Response for ListApplicationGateways API service call. + + :param value: List of an application gateways in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGateway] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ApplicationGateway"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayOnDemandProbe(msrest.serialization.Model): + """Details of on demand test probe request. + + :param protocol: The protocol used for the probe. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :type path: str + :param timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :type timeout: int + :param pick_host_name_from_backend_http_settings: Whether the host header should be picked from + the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param match: Criterion for classifying a healthy probe response. + :type match: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProbeHealthResponseMatch + :param backend_address_pool: Reference to backend pool of application gateway to which probe + request will be sent. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_http_settings: Reference to backend http setting of application gateway to be + used for test probe. + :type backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'match': {'key': 'match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, + host: Optional[str] = None, + path: Optional[str] = None, + timeout: Optional[int] = None, + pick_host_name_from_backend_http_settings: Optional[bool] = None, + match: Optional["ApplicationGatewayProbeHealthResponseMatch"] = None, + backend_address_pool: Optional["SubResource"] = None, + backend_http_settings: Optional["SubResource"] = None, + **kwargs + ): + super(ApplicationGatewayOnDemandProbe, self).__init__(**kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.timeout = timeout + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.match = match + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the path rule that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map path rule. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path map path rule. + :type backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path map path rule. + :type redirect_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param rewrite_rule_set: Rewrite rule set resource of URL path map path rule. + :type rewrite_rule_set: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the path rule resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'rewrite_rule_set': {'key': 'properties.rewriteRuleSet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + paths: Optional[List[str]] = None, + backend_address_pool: Optional["SubResource"] = None, + backend_http_settings: Optional["SubResource"] = None, + redirect_configuration: Optional["SubResource"] = None, + rewrite_rule_set: Optional["SubResource"] = None, + firewall_policy: Optional["SubResource"] = None, + **kwargs + ): + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.rewrite_rule_set = rewrite_rule_set + self.provisioning_state = None + self.firewall_policy = firewall_policy + + +class ApplicationGatewayPrivateEndpointConnection(SubResource): + """Private Endpoint connection on an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the private endpoint connection on an application gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the application gateway private endpoint + connection resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar link_identifier: The consumer link id. + :vartype link_identifier: str + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'private_endpoint': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'link_identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'link_identifier': {'key': 'properties.linkIdentifier', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(ApplicationGatewayPrivateEndpointConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_endpoint = None + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + self.link_identifier = None + + +class ApplicationGatewayPrivateEndpointConnectionListResult(msrest.serialization.Model): + """Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections for an application gateway. + + :param value: List of private endpoint connections on an application gateway. + :type value: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayPrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ApplicationGatewayPrivateEndpointConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayPrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayPrivateLinkConfiguration(SubResource): + """Private Link Configuration on an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the private link configuration that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param ip_configurations: An array of application gateway private link ip configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkIpConfiguration] + :ivar provisioning_state: The provisioning state of the application gateway private link + configuration. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[ApplicationGatewayPrivateLinkIpConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + ip_configurations: Optional[List["ApplicationGatewayPrivateLinkIpConfiguration"]] = None, + **kwargs + ): + super(ApplicationGatewayPrivateLinkConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.ip_configurations = ip_configurations + self.provisioning_state = None + + +class ApplicationGatewayPrivateLinkIpConfiguration(SubResource): + """The application gateway private link ip configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of application gateway private link ip configuration. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param primary: Whether the ip configuration is primary or not. + :type primary: bool + :ivar provisioning_state: The provisioning state of the application gateway private link IP + configuration. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + subnet: Optional["SubResource"] = None, + primary: Optional[bool] = None, + **kwargs + ): + super(ApplicationGatewayPrivateLinkIpConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.primary = primary + self.provisioning_state = None + + +class ApplicationGatewayPrivateLinkResource(SubResource): + """PrivateLink Resource of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the private link resource that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar group_id: Group identifier of private link resource. + :vartype group_id: str + :ivar required_members: Required member names of private link resource. + :vartype required_members: list[str] + :param required_zone_names: Required DNS zone names of the the private link resource. + :type required_zone_names: list[str] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(ApplicationGatewayPrivateLinkResource, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class ApplicationGatewayPrivateLinkResourceListResult(msrest.serialization.Model): + """Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an application gateway. + + :param value: List of private link resources of an application gateway. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkResource] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayPrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ApplicationGatewayPrivateLinkResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayPrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the probe that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param protocol: The protocol used for the probe. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is sent to + :code:``://:code:``::code:``:code:``. + :type path: str + :param interval: The probing interval in seconds. This is the time interval between two + consecutive probes. Acceptable values are from 1 second to 86400 seconds. + :type interval: int + :param timeout: The probe timeout in seconds. Probe marked as failed if valid response is not + received with this timeout period. Acceptable values are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is marked down after + consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second + to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header should be picked from + the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked healthy. Default value is + 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayProbeHealthResponseMatch + :ivar provisioning_state: The provisioning state of the probe resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param port: Custom port which will be used for probing the backend servers. The valid value + ranges from 1 to 65535. In case not set, port from http settings will be used. This property is + valid for Standard_v2 and WAF_v2 only. + :type port: int + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'port': {'maximum': 65535, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, + host: Optional[str] = None, + path: Optional[str] = None, + interval: Optional[int] = None, + timeout: Optional[int] = None, + unhealthy_threshold: Optional[int] = None, + pick_host_name_from_backend_http_settings: Optional[bool] = None, + min_servers: Optional[int] = None, + match: Optional["ApplicationGatewayProbeHealthResponseMatch"] = None, + port: Optional[int] = None, + **kwargs + ): + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = None + self.port = port + + +class ApplicationGatewayProbeHealthResponseMatch(msrest.serialization.Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range of healthy status + codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__( + self, + *, + body: Optional[str] = None, + status_codes: Optional[List[str]] = None, + **kwargs + ): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the redirect configuration that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param redirect_type: HTTP redirection type. Possible values include: "Permanent", "Found", + "SeeOther", "Temporary". + :type redirect_type: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request to. + :type target_listener: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect configuration. + :type request_routing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect configuration. + :type url_path_maps: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + redirect_type: Optional[Union[str, "ApplicationGatewayRedirectType"]] = None, + target_listener: Optional["SubResource"] = None, + target_url: Optional[str] = None, + include_path: Optional[bool] = None, + include_query_string: Optional[bool] = None, + request_routing_rules: Optional[List["SubResource"]] = None, + url_path_maps: Optional[List["SubResource"]] = None, + path_rules: Optional[List["SubResource"]] = None, + **kwargs + ): + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the request routing rule that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param rule_type: Rule type. Possible values include: "Basic", "PathBasedRouting". + :type rule_type: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRequestRoutingRuleType + :param priority: Priority of the request routing rule. + :type priority: int + :param backend_address_pool: Backend address pool resource of the application gateway. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_http_settings: Backend http settings resource of the application gateway. + :type backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param rewrite_rule_set: Rewrite Rule Set resource in Basic rule of the application gateway. + :type rewrite_rule_set: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the application gateway. + :type redirect_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the request routing rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'priority': {'maximum': 20000, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'rewrite_rule_set': {'key': 'properties.rewriteRuleSet', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + rule_type: Optional[Union[str, "ApplicationGatewayRequestRoutingRuleType"]] = None, + priority: Optional[int] = None, + backend_address_pool: Optional["SubResource"] = None, + backend_http_settings: Optional["SubResource"] = None, + http_listener: Optional["SubResource"] = None, + url_path_map: Optional["SubResource"] = None, + rewrite_rule_set: Optional["SubResource"] = None, + redirect_configuration: Optional["SubResource"] = None, + **kwargs + ): + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.rule_type = rule_type + self.priority = priority + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.rewrite_rule_set = rewrite_rule_set + self.redirect_configuration = redirect_configuration + self.provisioning_state = None + + +class ApplicationGatewayRewriteRule(msrest.serialization.Model): + """Rewrite rule of an application gateway. + + :param name: Name of the rewrite rule that is unique within an Application Gateway. + :type name: str + :param rule_sequence: Rule Sequence of the rewrite rule that determines the order of execution + of a particular rule in a RewriteRuleSet. + :type rule_sequence: int + :param conditions: Conditions based on which the action set execution will be evaluated. + :type conditions: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRuleCondition] + :param action_set: Set of actions to be done as part of the rewrite Rule. + :type action_set: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRuleActionSet + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'rule_sequence': {'key': 'ruleSequence', 'type': 'int'}, + 'conditions': {'key': 'conditions', 'type': '[ApplicationGatewayRewriteRuleCondition]'}, + 'action_set': {'key': 'actionSet', 'type': 'ApplicationGatewayRewriteRuleActionSet'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + rule_sequence: Optional[int] = None, + conditions: Optional[List["ApplicationGatewayRewriteRuleCondition"]] = None, + action_set: Optional["ApplicationGatewayRewriteRuleActionSet"] = None, + **kwargs + ): + super(ApplicationGatewayRewriteRule, self).__init__(**kwargs) + self.name = name + self.rule_sequence = rule_sequence + self.conditions = conditions + self.action_set = action_set + + +class ApplicationGatewayRewriteRuleActionSet(msrest.serialization.Model): + """Set of actions in the Rewrite Rule in Application Gateway. + + :param request_header_configurations: Request Header Actions in the Action Set. + :type request_header_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayHeaderConfiguration] + :param response_header_configurations: Response Header Actions in the Action Set. + :type response_header_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayHeaderConfiguration] + :param url_configuration: Url Configuration Action in the Action Set. + :type url_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayUrlConfiguration + """ + + _attribute_map = { + 'request_header_configurations': {'key': 'requestHeaderConfigurations', 'type': '[ApplicationGatewayHeaderConfiguration]'}, + 'response_header_configurations': {'key': 'responseHeaderConfigurations', 'type': '[ApplicationGatewayHeaderConfiguration]'}, + 'url_configuration': {'key': 'urlConfiguration', 'type': 'ApplicationGatewayUrlConfiguration'}, + } + + def __init__( + self, + *, + request_header_configurations: Optional[List["ApplicationGatewayHeaderConfiguration"]] = None, + response_header_configurations: Optional[List["ApplicationGatewayHeaderConfiguration"]] = None, + url_configuration: Optional["ApplicationGatewayUrlConfiguration"] = None, + **kwargs + ): + super(ApplicationGatewayRewriteRuleActionSet, self).__init__(**kwargs) + self.request_header_configurations = request_header_configurations + self.response_header_configurations = response_header_configurations + self.url_configuration = url_configuration + + +class ApplicationGatewayRewriteRuleCondition(msrest.serialization.Model): + """Set of conditions in the Rewrite Rule in Application Gateway. + + :param variable: The condition parameter of the RewriteRuleCondition. + :type variable: str + :param pattern: The pattern, either fixed string or regular expression, that evaluates the + truthfulness of the condition. + :type pattern: str + :param ignore_case: Setting this paramter to truth value with force the pattern to do a case + in-sensitive comparison. + :type ignore_case: bool + :param negate: Setting this value as truth will force to check the negation of the condition + given by the user. + :type negate: bool + """ + + _attribute_map = { + 'variable': {'key': 'variable', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, + 'negate': {'key': 'negate', 'type': 'bool'}, + } + + def __init__( + self, + *, + variable: Optional[str] = None, + pattern: Optional[str] = None, + ignore_case: Optional[bool] = None, + negate: Optional[bool] = None, + **kwargs + ): + super(ApplicationGatewayRewriteRuleCondition, self).__init__(**kwargs) + self.variable = variable + self.pattern = pattern + self.ignore_case = ignore_case + self.negate = negate + + +class ApplicationGatewayRewriteRuleSet(SubResource): + """Rewrite rule set of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the rewrite rule set that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param rewrite_rules: Rewrite rules in the rewrite rule set. + :type rewrite_rules: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayRewriteRule] + :ivar provisioning_state: The provisioning state of the rewrite rule set resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'rewrite_rules': {'key': 'properties.rewriteRules', 'type': '[ApplicationGatewayRewriteRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + rewrite_rules: Optional[List["ApplicationGatewayRewriteRule"]] = None, + **kwargs + ): + super(ApplicationGatewayRewriteRuleSet, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.rewrite_rules = rewrite_rules + self.provisioning_state = None + + +class ApplicationGatewaySku(msrest.serialization.Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: "Standard_Small", + "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large", "Standard_v2", "WAF_v2". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: "Standard", "WAF", + "Standard_v2", "WAF_v2". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "ApplicationGatewaySkuName"]] = None, + tier: Optional[Union[str, "ApplicationGatewayTier"]] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the SSL certificate that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT Request. + :type data: str + :param password: Password for the pfx file specified in data. Only applicable in PUT request. + :type password: str + :ivar public_cert_data: Base-64 encoded Public cert data corresponding to pfx specified in + data. Only applicable in GET request. + :vartype public_cert_data: str + :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :type key_vault_secret_id: str + :ivar provisioning_state: The provisioning state of the SSL certificate resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'public_cert_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + data: Optional[str] = None, + password: Optional[str] = None, + key_vault_secret_id: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.password = password + self.public_cert_data = None + self.key_vault_secret_id = key_vault_secret_id + self.provisioning_state = None + + +class ApplicationGatewaySslPolicy(msrest.serialization.Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". + :type policy_type: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values include: + "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S". + :type policy_name: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified order to application + gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". + :type min_protocol_version: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + disabled_ssl_protocols: Optional[List[Union[str, "ApplicationGatewaySslProtocol"]]] = None, + policy_type: Optional[Union[str, "ApplicationGatewaySslPolicyType"]] = None, + policy_name: Optional[Union[str, "ApplicationGatewaySslPolicyName"]] = None, + cipher_suites: Optional[List[Union[str, "ApplicationGatewaySslCipherSuite"]]] = None, + min_protocol_version: Optional[Union[str, "ApplicationGatewaySslProtocol"]] = None, + **kwargs + ): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of the Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified order for application + gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be supported on application + gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". + :type min_protocol_version: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + cipher_suites: Optional[List[Union[str, "ApplicationGatewaySslCipherSuite"]]] = None, + min_protocol_version: Optional[Union[str, "ApplicationGatewaySslProtocol"]] = None, + **kwargs + ): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version + + +class ApplicationGatewaySslProfile(SubResource): + """SSL profile of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the SSL profile that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param trusted_client_certificates: Array of references to application gateway trusted client + certificates. + :type trusted_client_certificates: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPolicy + :param client_auth_configuration: Client authentication configuration of the application + gateway resource. + :type client_auth_configuration: + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayClientAuthConfiguration + :ivar provisioning_state: The provisioning state of the HTTP listener resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'trusted_client_certificates': {'key': 'properties.trustedClientCertificates', 'type': '[SubResource]'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'client_auth_configuration': {'key': 'properties.clientAuthConfiguration', 'type': 'ApplicationGatewayClientAuthConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + trusted_client_certificates: Optional[List["SubResource"]] = None, + ssl_policy: Optional["ApplicationGatewaySslPolicy"] = None, + client_auth_configuration: Optional["ApplicationGatewayClientAuthConfiguration"] = None, + **kwargs + ): + super(ApplicationGatewaySslProfile, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.trusted_client_certificates = trusted_client_certificates + self.ssl_policy = ssl_policy + self.client_auth_configuration = client_auth_configuration + self.provisioning_state = None + + +class ApplicationGatewayTrustedClientCertificate(SubResource): + """Trusted client certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the trusted client certificate that is unique within an Application + Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Certificate public data. + :type data: str + :ivar provisioning_state: The provisioning state of the trusted client certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + data: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayTrustedClientCertificate, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.provisioning_state = None + + +class ApplicationGatewayTrustedRootCertificate(SubResource): + """Trusted Root certificates of an application gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the trusted root certificate that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param data: Certificate public data. + :type data: str + :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :type key_vault_secret_id: str + :ivar provisioning_state: The provisioning state of the trusted root certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + data: Optional[str] = None, + key_vault_secret_id: Optional[str] = None, + **kwargs + ): + super(ApplicationGatewayTrustedRootCertificate, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.data = data + self.key_vault_secret_id = key_vault_secret_id + self.provisioning_state = None + + +class ApplicationGatewayUrlConfiguration(msrest.serialization.Model): + """Url configuration of the Actions set in Application Gateway. + + :param modified_path: Url path which user has provided for url rewrite. Null means no path will + be updated. Default value is null. + :type modified_path: str + :param modified_query_string: Query string which user has provided for url rewrite. Null means + no query string will be updated. Default value is null. + :type modified_query_string: str + :param reroute: If set as true, it will re-evaluate the url path map provided in path based + request routing rules using modified path. Default value is false. + :type reroute: bool + """ + + _attribute_map = { + 'modified_path': {'key': 'modifiedPath', 'type': 'str'}, + 'modified_query_string': {'key': 'modifiedQueryString', 'type': 'str'}, + 'reroute': {'key': 'reroute', 'type': 'bool'}, + } + + def __init__( + self, + *, + modified_path: Optional[str] = None, + modified_query_string: Optional[str] = None, + reroute: Optional[bool] = None, + **kwargs + ): + super(ApplicationGatewayUrlConfiguration, self).__init__(**kwargs) + self.modified_path = modified_path + self.modified_query_string = modified_query_string + self.reroute = reroute + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the URL path map that is unique within an Application Gateway. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param default_backend_address_pool: Default backend address pool resource of URL path map. + :type default_backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param default_backend_http_settings: Default backend http settings resource of URL path map. + :type default_backend_http_settings: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param default_rewrite_rule_set: Default Rewrite rule set resource of URL path map. + :type default_rewrite_rule_set: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration resource of URL path map. + :type default_redirect_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPathRule] + :ivar provisioning_state: The provisioning state of the URL path map resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_rewrite_rule_set': {'key': 'properties.defaultRewriteRuleSet', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + default_backend_address_pool: Optional["SubResource"] = None, + default_backend_http_settings: Optional["SubResource"] = None, + default_rewrite_rule_set: Optional["SubResource"] = None, + default_redirect_configuration: Optional["SubResource"] = None, + path_rules: Optional[List["ApplicationGatewayPathRule"]] = None, + **kwargs + ): + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_rewrite_rule_set = default_rewrite_rule_set + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = None + + +class ApplicationGatewayWebApplicationFirewallConfiguration(msrest.serialization.Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible values include: + "Detection", "Prevention". + :type firewall_mode: str or + ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall rule set. Possible + values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + :param request_body_check: Whether allow WAF to check request Body. + :type request_body_check: bool + :param max_request_body_size: Maximum request body size for WAF. + :type max_request_body_size: int + :param max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :type max_request_body_size_in_kb: int + :param file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :type file_upload_limit_in_mb: int + :param exclusions: The exclusion list. + :type exclusions: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayFirewallExclusion] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'max_request_body_size': {'maximum': 128, 'minimum': 8}, + 'max_request_body_size_in_kb': {'maximum': 128, 'minimum': 8}, + 'file_upload_limit_in_mb': {'minimum': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'bool'}, + 'max_request_body_size': {'key': 'maxRequestBodySize', 'type': 'int'}, + 'max_request_body_size_in_kb': {'key': 'maxRequestBodySizeInKb', 'type': 'int'}, + 'file_upload_limit_in_mb': {'key': 'fileUploadLimitInMb', 'type': 'int'}, + 'exclusions': {'key': 'exclusions', 'type': '[ApplicationGatewayFirewallExclusion]'}, + } + + def __init__( + self, + *, + enabled: bool, + firewall_mode: Union[str, "ApplicationGatewayFirewallMode"], + rule_set_type: str, + rule_set_version: str, + disabled_rule_groups: Optional[List["ApplicationGatewayFirewallDisabledRuleGroup"]] = None, + request_body_check: Optional[bool] = None, + max_request_body_size: Optional[int] = None, + max_request_body_size_in_kb: Optional[int] = None, + file_upload_limit_in_mb: Optional[int] = None, + exclusions: Optional[List["ApplicationGatewayFirewallExclusion"]] = None, + **kwargs + ): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups + self.request_body_check = request_body_check + self.max_request_body_size = max_request_body_size + self.max_request_body_size_in_kb = max_request_body_size_in_kb + self.file_upload_limit_in_mb = file_upload_limit_in_mb + self.exclusions = exclusions + + +class FirewallPolicyRule(msrest.serialization.Model): + """Properties of a rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ApplicationRule, NatRule, NetworkRule. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + _subtype_map = { + 'rule_type': {'ApplicationRule': 'ApplicationRule', 'NatRule': 'NatRule', 'NetworkRule': 'NetworkRule'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(FirewallPolicyRule, self).__init__(**kwargs) + self.name = name + self.description = description + self.rule_type = None # type: Optional[str] + + +class ApplicationRule(FirewallPolicyRule): + """Rule of type application. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or Service Tags. + :type destination_addresses: list[str] + :param protocols: Array of Application Protocols. + :type protocols: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleApplicationProtocol] + :param target_fqdns: List of FQDNs for this rule. + :type target_fqdns: list[str] + :param target_urls: List of Urls for this rule condition. + :type target_urls: list[str] + :param fqdn_tags: List of FQDN Tags for this rule. + :type fqdn_tags: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param terminate_tls: Terminate TLS connections for this rule. + :type terminate_tls: bool + :param web_categories: List of destination azure web categories. + :type web_categories: list[str] + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[FirewallPolicyRuleApplicationProtocol]'}, + 'target_fqdns': {'key': 'targetFqdns', 'type': '[str]'}, + 'target_urls': {'key': 'targetUrls', 'type': '[str]'}, + 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'terminate_tls': {'key': 'terminateTLS', 'type': 'bool'}, + 'web_categories': {'key': 'webCategories', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + protocols: Optional[List["FirewallPolicyRuleApplicationProtocol"]] = None, + target_fqdns: Optional[List[str]] = None, + target_urls: Optional[List[str]] = None, + fqdn_tags: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + terminate_tls: Optional[bool] = None, + web_categories: Optional[List[str]] = None, + **kwargs + ): + super(ApplicationRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type = 'ApplicationRule' # type: str + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.protocols = protocols + self.target_fqdns = target_fqdns + self.target_urls = target_urls + self.fqdn_tags = fqdn_tags + self.source_ip_groups = source_ip_groups + self.terminate_tls = terminate_tls + self.web_categories = web_categories + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the application security group resource. It + uniquely identifies a resource, even if the user changes its name or migrate the resource + across subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application security group resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + + +class ApplicationSecurityGroupListResult(msrest.serialization.Model): + """A list of application security groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of application security groups. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ApplicationSecurityGroup"]] = None, + **kwargs + ): + super(ApplicationSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AuthorizationListResult(msrest.serialization.Model): + """Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + + :param value: The authorizations in an ExpressRoute Circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuitAuthorization"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AuthorizationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AutoApprovedPrivateLinkService(msrest.serialization.Model): + """The information of an AutoApprovedPrivateLinkService. + + :param private_link_service: The id of the private link service resource. + :type private_link_service: str + """ + + _attribute_map = { + 'private_link_service': {'key': 'privateLinkService', 'type': 'str'}, + } + + def __init__( + self, + *, + private_link_service: Optional[str] = None, + **kwargs + ): + super(AutoApprovedPrivateLinkService, self).__init__(**kwargs) + self.private_link_service = private_link_service + + +class AutoApprovedPrivateLinkServicesResult(msrest.serialization.Model): + """An array of private link service id that can be linked to a private end point with auto approved. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of auto approved private link service. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AutoApprovedPrivateLinkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AutoApprovedPrivateLinkService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AutoApprovedPrivateLinkService"]] = None, + **kwargs + ): + super(AutoApprovedPrivateLinkServicesResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Availability(msrest.serialization.Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + *, + time_grain: Optional[str] = None, + retention: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + super(Availability, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention + self.blob_duration = blob_duration + + +class AvailableDelegation(msrest.serialization.Model): + """The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. + + :param name: The name of the AvailableDelegation resource. + :type name: str + :param id: A unique identifier of the AvailableDelegation resource. + :type id: str + :param type: Resource type. + :type type: str + :param service_name: The name of the service and resource. + :type service_name: str + :param actions: The actions permitted to the service upon delegation. + :type actions: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, + type: Optional[str] = None, + service_name: Optional[str] = None, + actions: Optional[List[str]] = None, + **kwargs + ): + super(AvailableDelegation, self).__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.service_name = service_name + self.actions = actions + + +class AvailableDelegationsResult(msrest.serialization.Model): + """An array of available delegations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of available delegations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AvailableDelegation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailableDelegation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AvailableDelegation"]] = None, + **kwargs + ): + super(AvailableDelegationsResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AvailablePrivateEndpointType(msrest.serialization.Model): + """The information of an AvailablePrivateEndpointType. + + :param name: The name of the service and resource. + :type name: str + :param id: A unique identifier of the AvailablePrivateEndpoint Type resource. + :type id: str + :param type: Resource type. + :type type: str + :param resource_name: The name of the service and resource. + :type resource_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, + type: Optional[str] = None, + resource_name: Optional[str] = None, + **kwargs + ): + super(AvailablePrivateEndpointType, self).__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.resource_name = resource_name + + +class AvailablePrivateEndpointTypesResult(msrest.serialization.Model): + """An array of available PrivateEndpoint types. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of available privateEndpoint type. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AvailablePrivateEndpointType] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailablePrivateEndpointType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AvailablePrivateEndpointType"]] = None, + **kwargs + ): + super(AvailablePrivateEndpointTypesResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AvailableProvidersList(msrest.serialization.Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: list[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__( + self, + *, + countries: List["AvailableProvidersListCountry"], + **kwargs + ): + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = countries + + +class AvailableProvidersListCity(msrest.serialization.Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__( + self, + *, + city_name: Optional[str] = None, + providers: Optional[List[str]] = None, + **kwargs + ): + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = city_name + self.providers = providers + + +class AvailableProvidersListCountry(msrest.serialization.Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: list[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__( + self, + *, + country_name: Optional[str] = None, + providers: Optional[List[str]] = None, + states: Optional[List["AvailableProvidersListState"]] = None, + **kwargs + ): + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = country_name + self.providers = providers + self.states = states + + +class AvailableProvidersListParameters(msrest.serialization.Model): + """Constraints that determine the list of available Internet service providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__( + self, + *, + azure_locations: Optional[List[str]] = None, + country: Optional[str] = None, + state: Optional[str] = None, + city: Optional[str] = None, + **kwargs + ): + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = azure_locations + self.country = country + self.state = state + self.city = city + + +class AvailableProvidersListState(msrest.serialization.Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: list[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__( + self, + *, + state_name: Optional[str] = None, + providers: Optional[List[str]] = None, + cities: Optional[List["AvailableProvidersListCity"]] = None, + **kwargs + ): + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = state_name + self.providers = providers + self.cities = cities + + +class AvailableServiceAlias(msrest.serialization.Model): + """The available service alias. + + :param name: The name of the service alias. + :type name: str + :param id: The ID of the service alias. + :type id: str + :param type: The type of the resource. + :type type: str + :param resource_name: The resource name of the service alias. + :type resource_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, + type: Optional[str] = None, + resource_name: Optional[str] = None, + **kwargs + ): + super(AvailableServiceAlias, self).__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.resource_name = resource_name + + +class AvailableServiceAliasesResult(msrest.serialization.Model): + """An array of available service aliases. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: An array of available service aliases. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AvailableServiceAlias] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailableServiceAlias]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AvailableServiceAlias"]] = None, + **kwargs + ): + super(AvailableServiceAliasesResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AzureAsyncOperationResult(msrest.serialization.Model): + """The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information regarding the failure. + + :param status: Status of the Azure async operation. Possible values include: "InProgress", + "Succeeded", "Failed". + :type status: str or ~azure.mgmt.network.v2020_07_01.models.NetworkOperationStatus + :param error: Details of the error occurred during specified asynchronous operation. + :type error: ~azure.mgmt.network.v2020_07_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "NetworkOperationStatus"]] = None, + error: Optional["Error"] = None, + **kwargs + ): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error + + +class AzureFirewall(Resource): + """Azure Firewall resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param zones: A list of availability zones denoting where the resource needs to come from. + :type zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param application_rule_collections: Collection of application rule collections used by Azure + Firewall. + :type application_rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRuleCollection] + :param nat_rule_collections: Collection of NAT rule collections used by Azure Firewall. + :type nat_rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRuleCollection] + :param network_rule_collections: Collection of network rule collections used by Azure Firewall. + :type network_rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallIPConfiguration] + :param management_ip_configuration: IP configuration of the Azure Firewall used for management + traffic. + :type management_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallIPConfiguration + :ivar provisioning_state: The provisioning state of the Azure firewall resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param threat_intel_mode: The operation mode for Threat Intelligence. Possible values include: + "Alert", "Deny", "Off". + :type threat_intel_mode: str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallThreatIntelMode + :param virtual_hub: The virtualHub to which the firewall belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param firewall_policy: The firewallPolicy associated with this azure firewall. + :type firewall_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param hub_ip_addresses: IP addresses associated with AzureFirewall. + :type hub_ip_addresses: ~azure.mgmt.network.v2020_07_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallIpGroups] + :param sku: The Azure Firewall Resource SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallSku + :param additional_properties: The additional properties used to further config this azure + firewall. + :type additional_properties: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'ip_groups': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'application_rule_collections': {'key': 'properties.applicationRuleCollections', 'type': '[AzureFirewallApplicationRuleCollection]'}, + 'nat_rule_collections': {'key': 'properties.natRuleCollections', 'type': '[AzureFirewallNatRuleCollection]'}, + 'network_rule_collections': {'key': 'properties.networkRuleCollections', 'type': '[AzureFirewallNetworkRuleCollection]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[AzureFirewallIPConfiguration]'}, + 'management_ip_configuration': {'key': 'properties.managementIpConfiguration', 'type': 'AzureFirewallIPConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'firewall_policy': {'key': 'properties.firewallPolicy', 'type': 'SubResource'}, + 'hub_ip_addresses': {'key': 'properties.hubIPAddresses', 'type': 'HubIPAddresses'}, + 'ip_groups': {'key': 'properties.ipGroups', 'type': '[AzureFirewallIpGroups]'}, + 'sku': {'key': 'properties.sku', 'type': 'AzureFirewallSku'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': '{str}'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + application_rule_collections: Optional[List["AzureFirewallApplicationRuleCollection"]] = None, + nat_rule_collections: Optional[List["AzureFirewallNatRuleCollection"]] = None, + network_rule_collections: Optional[List["AzureFirewallNetworkRuleCollection"]] = None, + ip_configurations: Optional[List["AzureFirewallIPConfiguration"]] = None, + management_ip_configuration: Optional["AzureFirewallIPConfiguration"] = None, + threat_intel_mode: Optional[Union[str, "AzureFirewallThreatIntelMode"]] = None, + virtual_hub: Optional["SubResource"] = None, + firewall_policy: Optional["SubResource"] = None, + hub_ip_addresses: Optional["HubIPAddresses"] = None, + sku: Optional["AzureFirewallSku"] = None, + additional_properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(AzureFirewall, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.zones = zones + self.etag = None + self.application_rule_collections = application_rule_collections + self.nat_rule_collections = nat_rule_collections + self.network_rule_collections = network_rule_collections + self.ip_configurations = ip_configurations + self.management_ip_configuration = management_ip_configuration + self.provisioning_state = None + self.threat_intel_mode = threat_intel_mode + self.virtual_hub = virtual_hub + self.firewall_policy = firewall_policy + self.hub_ip_addresses = hub_ip_addresses + self.ip_groups = None + self.sku = sku + self.additional_properties = additional_properties + + +class AzureFirewallApplicationRule(msrest.serialization.Model): + """Properties of an application rule. + + :param name: Name of the application rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param protocols: Array of ApplicationRuleProtocols. + :type protocols: + list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRuleProtocol] + :param target_fqdns: List of FQDNs for this rule. + :type target_fqdns: list[str] + :param fqdn_tags: List of FQDN Tags for this rule. + :type fqdn_tags: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[AzureFirewallApplicationRuleProtocol]'}, + 'target_fqdns': {'key': 'targetFqdns', 'type': '[str]'}, + 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + source_addresses: Optional[List[str]] = None, + protocols: Optional[List["AzureFirewallApplicationRuleProtocol"]] = None, + target_fqdns: Optional[List[str]] = None, + fqdn_tags: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + **kwargs + ): + super(AzureFirewallApplicationRule, self).__init__(**kwargs) + self.name = name + self.description = description + self.source_addresses = source_addresses + self.protocols = protocols + self.target_fqdns = target_fqdns + self.fqdn_tags = fqdn_tags + self.source_ip_groups = source_ip_groups + + +class AzureFirewallApplicationRuleCollection(SubResource): + """Application rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Priority of the application rule collection resource. + :type priority: int + :param action: The action type of a rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRule] + :ivar provisioning_state: The provisioning state of the application rule collection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallApplicationRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["AzureFirewallRCAction"] = None, + rules: Optional[List["AzureFirewallApplicationRule"]] = None, + **kwargs + ): + super(AzureFirewallApplicationRuleCollection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = None + + +class AzureFirewallApplicationRuleProtocol(msrest.serialization.Model): + """Properties of the application rule protocol. + + :param protocol_type: Protocol type. Possible values include: "Http", "Https", "Mssql". + :type protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallApplicationRuleProtocolType + :param port: Port number for the protocol, cannot be greater than 64000. This field is + optional. + :type port: int + """ + + _validation = { + 'port': {'maximum': 64000, 'minimum': 0}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + protocol_type: Optional[Union[str, "AzureFirewallApplicationRuleProtocolType"]] = None, + port: Optional[int] = None, + **kwargs + ): + super(AzureFirewallApplicationRuleProtocol, self).__init__(**kwargs) + self.protocol_type = protocol_type + self.port = port + + +class AzureFirewallFqdnTag(Resource): + """Azure Firewall FQDN Tag Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the Azure firewall FQDN tag resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar fqdn_tag_name: The name of this FQDN Tag. + :vartype fqdn_tag_name: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'fqdn_tag_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'fqdn_tag_name': {'key': 'properties.fqdnTagName', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(AzureFirewallFqdnTag, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + self.fqdn_tag_name = None + + +class AzureFirewallFqdnTagListResult(msrest.serialization.Model): + """Response for ListAzureFirewallFqdnTags API service call. + + :param value: List of Azure Firewall FQDN Tags in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallFqdnTag] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureFirewallFqdnTag]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AzureFirewallFqdnTag"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AzureFirewallFqdnTagListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AzureFirewallIPConfiguration(SubResource): + """IP configuration of an Azure Firewall. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar private_ip_address: The Firewall Internal Load Balancer IP to be used as the next hop in + User Defined Routes. + :vartype private_ip_address: str + :param subnet: Reference to the subnet resource. This resource must be named + 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. This field is a mandatory input + if subnet is not null. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the Azure firewall IP configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + subnet: Optional["SubResource"] = None, + public_ip_address: Optional["SubResource"] = None, + **kwargs + ): + super(AzureFirewallIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = None + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + + +class AzureFirewallIpGroups(msrest.serialization.Model): + """IpGroups associated with azure firewall. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar change_number: The iteration number. + :vartype change_number: str + """ + + _validation = { + 'id': {'readonly': True}, + 'change_number': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'change_number': {'key': 'changeNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFirewallIpGroups, self).__init__(**kwargs) + self.id = None + self.change_number = None + + +class AzureFirewallListResult(msrest.serialization.Model): + """Response for ListAzureFirewalls API service call. + + :param value: List of Azure Firewalls in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewall] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureFirewall]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AzureFirewall"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AzureFirewallListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AzureFirewallNatRCAction(msrest.serialization.Model): + """AzureFirewall NAT Rule Collection Action. + + :param type: The type of action. Possible values include: "Snat", "Dnat". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRCActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "AzureFirewallNatRCActionType"]] = None, + **kwargs + ): + super(AzureFirewallNatRCAction, self).__init__(**kwargs) + self.type = type + + +class AzureFirewallNatRule(msrest.serialization.Model): + """Properties of a NAT rule. + + :param name: Name of the NAT rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses for this rule. Supports IP + ranges, prefixes, and service tags. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param protocols: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + :type protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRuleProtocol] + :param translated_address: The translated address for this NAT rule. + :type translated_address: str + :param translated_port: The translated port for this NAT rule. + :type translated_port: str + :param translated_fqdn: The translated FQDN for this NAT rule. + :type translated_fqdn: str + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, + 'translated_address': {'key': 'translatedAddress', 'type': 'str'}, + 'translated_port': {'key': 'translatedPort', 'type': 'str'}, + 'translated_fqdn': {'key': 'translatedFqdn', 'type': 'str'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + protocols: Optional[List[Union[str, "AzureFirewallNetworkRuleProtocol"]]] = None, + translated_address: Optional[str] = None, + translated_port: Optional[str] = None, + translated_fqdn: Optional[str] = None, + source_ip_groups: Optional[List[str]] = None, + **kwargs + ): + super(AzureFirewallNatRule, self).__init__(**kwargs) + self.name = name + self.description = description + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.protocols = protocols + self.translated_address = translated_address + self.translated_port = translated_port + self.translated_fqdn = translated_fqdn + self.source_ip_groups = source_ip_groups + + +class AzureFirewallNatRuleCollection(SubResource): + """NAT rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Priority of the NAT rule collection resource. + :type priority: int + :param action: The action type of a NAT rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRCAction + :param rules: Collection of rules used by a NAT rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNatRule] + :ivar provisioning_state: The provisioning state of the NAT rule collection resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallNatRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallNatRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["AzureFirewallNatRCAction"] = None, + rules: Optional[List["AzureFirewallNatRule"]] = None, + **kwargs + ): + super(AzureFirewallNatRuleCollection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = None + + +class AzureFirewallNetworkRule(msrest.serialization.Model): + """Properties of the network rule. + + :param name: Name of the network rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param protocols: Array of AzureFirewallNetworkRuleProtocols. + :type protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRuleProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param destination_fqdns: List of destination FQDNs. + :type destination_fqdns: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param destination_ip_groups: List of destination IpGroups for this rule. + :type destination_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'destination_fqdns': {'key': 'destinationFqdns', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'destination_ip_groups': {'key': 'destinationIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + protocols: Optional[List[Union[str, "AzureFirewallNetworkRuleProtocol"]]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + destination_fqdns: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + destination_ip_groups: Optional[List[str]] = None, + **kwargs + ): + super(AzureFirewallNetworkRule, self).__init__(**kwargs) + self.name = name + self.description = description + self.protocols = protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.destination_fqdns = destination_fqdns + self.source_ip_groups = source_ip_groups + self.destination_ip_groups = destination_ip_groups + + +class AzureFirewallNetworkRuleCollection(SubResource): + """Network rule collection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the Azure firewall. This name can + be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Priority of the network rule collection resource. + :type priority: int + :param action: The action type of a rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallNetworkRule] + :ivar provisioning_state: The provisioning state of the network rule collection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallNetworkRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["AzureFirewallRCAction"] = None, + rules: Optional[List["AzureFirewallNetworkRule"]] = None, + **kwargs + ): + super(AzureFirewallNetworkRuleCollection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = None + + +class AzureFirewallPublicIPAddress(msrest.serialization.Model): + """Public IP Address associated with azure firewall. + + :param address: Public IP Address value. + :type address: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + *, + address: Optional[str] = None, + **kwargs + ): + super(AzureFirewallPublicIPAddress, self).__init__(**kwargs) + self.address = address + + +class AzureFirewallRCAction(msrest.serialization.Model): + """Properties of the AzureFirewallRCAction. + + :param type: The type of action. Possible values include: "Allow", "Deny". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallRCActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "AzureFirewallRCActionType"]] = None, + **kwargs + ): + super(AzureFirewallRCAction, self).__init__(**kwargs) + self.type = type + + +class AzureFirewallSku(msrest.serialization.Model): + """SKU of an Azure Firewall. + + :param name: Name of an Azure Firewall SKU. Possible values include: "AZFW_VNet", "AZFW_Hub". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallSkuName + :param tier: Tier of an Azure Firewall. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.AzureFirewallSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "AzureFirewallSkuName"]] = None, + tier: Optional[Union[str, "AzureFirewallSkuTier"]] = None, + **kwargs + ): + super(AzureFirewallSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class AzureReachabilityReport(msrest.serialization.Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure reachability report. Can be + Country, State or City. + :type aggregation_level: str + :param provider_location: Required. Parameters that define a geographic location. + :type provider_location: ~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report items. + :type reachability_report: + list[~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__( + self, + *, + aggregation_level: str, + provider_location: "AzureReachabilityReportLocation", + reachability_report: List["AzureReachabilityReportItem"], + **kwargs + ): + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = aggregation_level + self.provider_location = provider_location + self.reachability_report = reachability_report + + +class AzureReachabilityReportItem(msrest.serialization.Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + azure_location: Optional[str] = None, + latencies: Optional[List["AzureReachabilityReportLatencyInfo"]] = None, + **kwargs + ): + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = provider + self.azure_location = azure_location + self.latencies = latencies + + +class AzureReachabilityReportLatencyInfo(msrest.serialization.Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: ~datetime.datetime + :param score: The relative latency score between 1 and 100, higher values indicating a faster + connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__( + self, + *, + time_stamp: Optional[datetime.datetime] = None, + score: Optional[int] = None, + **kwargs + ): + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = time_stamp + self.score = score + + +class AzureReachabilityReportLocation(msrest.serialization.Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__( + self, + *, + country: str, + state: Optional[str] = None, + city: Optional[str] = None, + **kwargs + ): + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = country + self.state = state + self.city = city + + +class AzureReachabilityReportParameters(msrest.serialization.Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. Parameters that define a geographic location. + :type provider_location: ~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability report. + :type start_time: ~datetime.datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: ~datetime.datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + provider_location: "AzureReachabilityReportLocation", + start_time: datetime.datetime, + end_time: datetime.datetime, + providers: Optional[List[str]] = None, + azure_locations: Optional[List[str]] = None, + **kwargs + ): + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = provider_location + self.providers = providers + self.azure_locations = azure_locations + self.start_time = start_time + self.end_time = end_time + + +class AzureWebCategory(msrest.serialization.Model): + """Azure Web Category Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar group: The name of the group that the category belongs to. + :vartype group: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'group': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'group': {'key': 'properties.group', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(AzureWebCategory, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.etag = None + self.group = None + + +class AzureWebCategoryListResult(msrest.serialization.Model): + """Response for ListAzureWebCategories API service call. + + :param value: List of Azure Web Categories for a given Subscription. + :type value: list[~azure.mgmt.network.v2020_07_01.models.AzureWebCategory] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureWebCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AzureWebCategory"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AzureWebCategoryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of backend address pools + used by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param load_balancer_backend_addresses: An array of backend addresses. + :type load_balancer_backend_addresses: + list[~azure.mgmt.network.v2020_07_01.models.LoadBalancerBackendAddress] + :ivar backend_ip_configurations: An array of references to IP addresses defined in network + interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: An array of references to load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar outbound_rule: A reference to an outbound rule that uses this backend address pool. + :vartype outbound_rule: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar outbound_rules: An array of references to outbound rules that use this backend address + pool. + :vartype outbound_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the backend address pool resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_rule': {'readonly': True}, + 'outbound_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'load_balancer_backend_addresses': {'key': 'properties.loadBalancerBackendAddresses', 'type': '[LoadBalancerBackendAddress]'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_rule': {'key': 'properties.outboundRule', 'type': 'SubResource'}, + 'outbound_rules': {'key': 'properties.outboundRules', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + load_balancer_backend_addresses: Optional[List["LoadBalancerBackendAddress"]] = None, + **kwargs + ): + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.load_balancer_backend_addresses = load_balancer_backend_addresses + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_rule = None + self.outbound_rules = None + self.provisioning_state = None + + +class BastionActiveSession(msrest.serialization.Model): + """The session detail for a target. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar session_id: A unique id for the session. + :vartype session_id: str + :ivar start_time: The time when the session started. + :vartype start_time: object + :ivar target_subscription_id: The subscription id for the target virtual machine. + :vartype target_subscription_id: str + :ivar resource_type: The type of the resource. + :vartype resource_type: str + :ivar target_host_name: The host name of the target. + :vartype target_host_name: str + :ivar target_resource_group: The resource group of the target. + :vartype target_resource_group: str + :ivar user_name: The user name who is active on this session. + :vartype user_name: str + :ivar target_ip_address: The IP Address of the target. + :vartype target_ip_address: str + :ivar protocol: The protocol used to connect to the target. Possible values include: "SSH", + "RDP". + :vartype protocol: str or ~azure.mgmt.network.v2020_07_01.models.BastionConnectProtocol + :ivar target_resource_id: The resource id of the target. + :vartype target_resource_id: str + :ivar session_duration_in_mins: Duration in mins the session has been active. + :vartype session_duration_in_mins: float + """ + + _validation = { + 'session_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'target_subscription_id': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'target_host_name': {'readonly': True}, + 'target_resource_group': {'readonly': True}, + 'user_name': {'readonly': True}, + 'target_ip_address': {'readonly': True}, + 'protocol': {'readonly': True}, + 'target_resource_id': {'readonly': True}, + 'session_duration_in_mins': {'readonly': True}, + } + + _attribute_map = { + 'session_id': {'key': 'sessionId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'object'}, + 'target_subscription_id': {'key': 'targetSubscriptionId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'target_host_name': {'key': 'targetHostName', 'type': 'str'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'target_ip_address': {'key': 'targetIpAddress', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'session_duration_in_mins': {'key': 'sessionDurationInMins', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionActiveSession, self).__init__(**kwargs) + self.session_id = None + self.start_time = None + self.target_subscription_id = None + self.resource_type = None + self.target_host_name = None + self.target_resource_group = None + self.user_name = None + self.target_ip_address = None + self.protocol = None + self.target_resource_id = None + self.session_duration_in_mins = None + + +class BastionActiveSessionListResult(msrest.serialization.Model): + """Response for GetActiveSessions. + + :param value: List of active sessions on the bastion. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionActiveSession] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionActiveSession]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BastionActiveSession"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(BastionActiveSessionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionHost(Resource): + """Bastion Host resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param ip_configurations: IP configuration of the Bastion Host resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.BastionHostIPConfiguration] + :param dns_name: FQDN for the endpoint on which bastion host is accessible. + :type dns_name: str + :ivar provisioning_state: The provisioning state of the bastion host resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[BastionHostIPConfiguration]'}, + 'dns_name': {'key': 'properties.dnsName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + ip_configurations: Optional[List["BastionHostIPConfiguration"]] = None, + dns_name: Optional[str] = None, + **kwargs + ): + super(BastionHost, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.ip_configurations = ip_configurations + self.dns_name = dns_name + self.provisioning_state = None + + +class BastionHostIPConfiguration(SubResource): + """IP configuration of an Bastion Host. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Ip configuration type. + :vartype type: str + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the bastion host IP configuration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_ip_allocation_method: Private IP allocation method. Possible values include: + "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + subnet: Optional["SubResource"] = None, + public_ip_address: Optional["SubResource"] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + **kwargs + ): + super(BastionHostIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.private_ip_allocation_method = private_ip_allocation_method + + +class BastionHostListResult(msrest.serialization.Model): + """Response for ListBastionHosts API service call. + + :param value: List of Bastion Hosts in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionHost] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionHost]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BastionHost"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(BastionHostListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionSessionDeleteResult(msrest.serialization.Model): + """Response for DisconnectActiveSessions. + + :param value: List of sessions with their corresponding state. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionSessionState] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionSessionState]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BastionSessionState"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(BastionSessionDeleteResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BastionSessionState(msrest.serialization.Model): + """The session state detail for a target. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar session_id: A unique id for the session. + :vartype session_id: str + :ivar message: Used for extra information. + :vartype message: str + :ivar state: The state of the session. Disconnected/Failed/NotFound. + :vartype state: str + """ + + _validation = { + 'session_id': {'readonly': True}, + 'message': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'session_id': {'key': 'sessionId', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BastionSessionState, self).__init__(**kwargs) + self.session_id = None + self.message = None + self.state = None + + +class BastionShareableLink(msrest.serialization.Model): + """Bastion Shareable Link. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param vm: Required. Reference of the virtual machine resource. + :type vm: ~azure.mgmt.network.v2020_07_01.models.Resource + :ivar bsl: The unique Bastion Shareable Link to the virtual machine. + :vartype bsl: str + :ivar created_at: The time when the link was created. + :vartype created_at: str + :ivar message: Optional field indicating the warning or error message related to the vm in case + of partial failure. + :vartype message: str + """ + + _validation = { + 'vm': {'required': True}, + 'bsl': {'readonly': True}, + 'created_at': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'vm': {'key': 'vm', 'type': 'Resource'}, + 'bsl': {'key': 'bsl', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + vm: "Resource", + **kwargs + ): + super(BastionShareableLink, self).__init__(**kwargs) + self.vm = vm + self.bsl = None + self.created_at = None + self.message = None + + +class BastionShareableLinkListRequest(msrest.serialization.Model): + """Post request for all the Bastion Shareable Link endpoints. + + :param vms: List of VM references. + :type vms: list[~azure.mgmt.network.v2020_07_01.models.BastionShareableLink] + """ + + _attribute_map = { + 'vms': {'key': 'vms', 'type': '[BastionShareableLink]'}, + } + + def __init__( + self, + *, + vms: Optional[List["BastionShareableLink"]] = None, + **kwargs + ): + super(BastionShareableLinkListRequest, self).__init__(**kwargs) + self.vms = vms + + +class BastionShareableLinkListResult(msrest.serialization.Model): + """Response for all the Bastion Shareable Link endpoints. + + :param value: List of Bastion Shareable Links for the request. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BastionShareableLink] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BastionShareableLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BastionShareableLink"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(BastionShareableLinkListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BGPCommunity(msrest.serialization.Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. e.g. For O365, region is + Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + service_supported_region: Optional[str] = None, + community_name: Optional[str] = None, + community_value: Optional[str] = None, + community_prefixes: Optional[List[str]] = None, + is_authorized_to_use: Optional[bool] = None, + service_group: Optional[str] = None, + **kwargs + ): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group + + +class BgpConnection(SubResource): + """Virtual Appliance Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the connection. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Connection type. + :vartype type: str + :param peer_asn: Peer ASN. + :type peer_asn: long + :param peer_ip: Peer IP. + :type peer_ip: str + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar connection_state: The current state of the VirtualHub to Peer. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_state: str or ~azure.mgmt.network.v2020_07_01.models.HubBgpConnectionStatus + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + 'connection_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peer_asn': {'key': 'properties.peerAsn', 'type': 'long'}, + 'peer_ip': {'key': 'properties.peerIp', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'connection_state': {'key': 'properties.connectionState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + peer_asn: Optional[int] = None, + peer_ip: Optional[str] = None, + **kwargs + ): + super(BgpConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.peer_asn = peer_asn + self.peer_ip = peer_ip + self.provisioning_state = None + self.connection_state = None + + +class BgpPeerStatus(msrest.serialization.Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The virtual network gateway's local address. + :vartype local_address: str + :ivar neighbor: The remote BGP peer. + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer. + :vartype asn: long + :ivar state: The BGP peer state. Possible values include: "Unknown", "Stopped", "Idle", + "Connecting", "Connected". + :vartype state: str or ~azure.mgmt.network.v2020_07_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up. + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer. + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent. + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received. + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'long'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None + + +class BgpPeerStatusListResult(msrest.serialization.Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__( + self, + *, + value: Optional[List["BgpPeerStatus"]] = None, + **kwargs + ): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: A list of bgp communities. + :type bgp_communities: list[~azure.mgmt.network.v2020_07_01.models.BGPCommunity] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + service_name: Optional[str] = None, + bgp_communities: Optional[List["BGPCommunity"]] = None, + **kwargs + ): + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities + + +class BgpServiceCommunityListResult(msrest.serialization.Model): + """Response for the ListServiceCommunity API service call. + + :param value: A list of service community resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BgpServiceCommunity] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpServiceCommunity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BgpServiceCommunity"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(BgpServiceCommunityListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class BgpSettings(msrest.serialization.Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP speaker. + :type peer_weight: int + :param bgp_peering_addresses: BGP peering address with IP configuration ID for virtual network + gateway. + :type bgp_peering_addresses: + list[~azure.mgmt.network.v2020_07_01.models.IPConfigurationBgpPeeringAddress] + """ + + _validation = { + 'asn': {'maximum': 4294967295, 'minimum': 0}, + } + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + 'bgp_peering_addresses': {'key': 'bgpPeeringAddresses', 'type': '[IPConfigurationBgpPeeringAddress]'}, + } + + def __init__( + self, + *, + asn: Optional[int] = None, + bgp_peering_address: Optional[str] = None, + peer_weight: Optional[int] = None, + bgp_peering_addresses: Optional[List["IPConfigurationBgpPeeringAddress"]] = None, + **kwargs + ): + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight + self.bgp_peering_addresses = bgp_peering_addresses + + +class BreakOutCategoryPolicies(msrest.serialization.Model): + """Network Virtual Appliance Sku Properties. + + :param allow: Flag to control breakout of o365 allow category. + :type allow: bool + :param optimize: Flag to control breakout of o365 optimize category. + :type optimize: bool + :param default: Flag to control breakout of o365 default category. + :type default: bool + """ + + _attribute_map = { + 'allow': {'key': 'allow', 'type': 'bool'}, + 'optimize': {'key': 'optimize', 'type': 'bool'}, + 'default': {'key': 'default', 'type': 'bool'}, + } + + def __init__( + self, + *, + allow: Optional[bool] = None, + optimize: Optional[bool] = None, + default: Optional[bool] = None, + **kwargs + ): + super(BreakOutCategoryPolicies, self).__init__(**kwargs) + self.allow = allow + self.optimize = optimize + self.default = default + + +class CheckPrivateLinkServiceVisibilityRequest(msrest.serialization.Model): + """Request body of the CheckPrivateLinkServiceVisibility API service call. + + :param private_link_service_alias: The alias of the private link service. + :type private_link_service_alias: str + """ + + _attribute_map = { + 'private_link_service_alias': {'key': 'privateLinkServiceAlias', 'type': 'str'}, + } + + def __init__( + self, + *, + private_link_service_alias: Optional[str] = None, + **kwargs + ): + super(CheckPrivateLinkServiceVisibilityRequest, self).__init__(**kwargs) + self.private_link_service_alias = private_link_service_alias + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.network.v2020_07_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ConnectionMonitor(msrest.serialization.Model): + """Parameters that define the operation to create a connection monitor. + + :param location: Connection monitor location. + :type location: str + :param tags: A set of tags. Connection monitor tags. + :type tags: dict[str, str] + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _validation = { + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'properties.endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'properties.testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'properties.testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'properties.outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["ConnectionMonitorSource"] = None, + destination: Optional["ConnectionMonitorDestination"] = None, + auto_start: Optional[bool] = True, + monitoring_interval_in_seconds: Optional[int] = 60, + endpoints: Optional[List["ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.endpoints = endpoints + self.test_configurations = test_configurations + self.test_groups = test_groups + self.outputs = outputs + self.notes = notes + + +class ConnectionMonitorDestination(msrest.serialization.Model): + """Describes the destination of connection monitor. + + :param resource_id: The ID of the resource used as the destination by connection monitor. + :type resource_id: str + :param address: Address of the connection monitor destination (IP or domain name). + :type address: str + :param port: The destination port used by connection monitor. + :type port: int + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + address: Optional[str] = None, + port: Optional[int] = None, + **kwargs + ): + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port + + +class ConnectionMonitorEndpoint(msrest.serialization.Model): + """Describes the connection monitor endpoint. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the connection monitor endpoint. + :type name: str + :param type: The endpoint type. Possible values include: "AzureVM", "AzureVNet", "AzureSubnet", + "ExternalAddress", "MMAWorkspaceMachine", "MMAWorkspaceNetwork". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.EndpointType + :param resource_id: Resource ID of the connection monitor endpoint. + :type resource_id: str + :param address: Address of the connection monitor endpoint (IP or domain name). + :type address: str + :param filter: Filter for sub-items within the endpoint. + :type filter: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilter + :param scope: Endpoint scope. + :type scope: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointScope + :param coverage_level: Test coverage for the endpoint. Possible values include: "Default", + "Low", "BelowAverage", "Average", "AboveAverage", "Full". + :type coverage_level: str or ~azure.mgmt.network.v2020_07_01.models.CoverageLevel + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ConnectionMonitorEndpointFilter'}, + 'scope': {'key': 'scope', 'type': 'ConnectionMonitorEndpointScope'}, + 'coverage_level': {'key': 'coverageLevel', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Optional[Union[str, "EndpointType"]] = None, + resource_id: Optional[str] = None, + address: Optional[str] = None, + filter: Optional["ConnectionMonitorEndpointFilter"] = None, + scope: Optional["ConnectionMonitorEndpointScope"] = None, + coverage_level: Optional[Union[str, "CoverageLevel"]] = None, + **kwargs + ): + super(ConnectionMonitorEndpoint, self).__init__(**kwargs) + self.name = name + self.type = type + self.resource_id = resource_id + self.address = address + self.filter = filter + self.scope = scope + self.coverage_level = coverage_level + + +class ConnectionMonitorEndpointFilter(msrest.serialization.Model): + """Describes the connection monitor endpoint filter. + + :param type: The behavior of the endpoint filter. Currently only 'Include' is supported. + Possible values include: "Include". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilterType + :param items: List of items in the filter. + :type items: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'items': {'key': 'items', 'type': '[ConnectionMonitorEndpointFilterItem]'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ConnectionMonitorEndpointFilterType"]] = None, + items: Optional[List["ConnectionMonitorEndpointFilterItem"]] = None, + **kwargs + ): + super(ConnectionMonitorEndpointFilter, self).__init__(**kwargs) + self.type = type + self.items = items + + +class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): + """Describes the connection monitor endpoint filter item. + + :param type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. Possible values include: "AgentAddress". + :type type: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointFilterItemType + :param address: The address of the filter item. + :type address: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ConnectionMonitorEndpointFilterItemType"]] = None, + address: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorEndpointFilterItem, self).__init__(**kwargs) + self.type = type + self.address = address + + +class ConnectionMonitorEndpointScope(msrest.serialization.Model): + """Describes the connection monitor endpoint scope. + + :param include: List of items which needs to be included to the endpoint scope. + :type include: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointScopeItem] + :param exclude: List of items which needs to be excluded from the endpoint scope. + :type exclude: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpointScopeItem] + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': '[ConnectionMonitorEndpointScopeItem]'}, + 'exclude': {'key': 'exclude', 'type': '[ConnectionMonitorEndpointScopeItem]'}, + } + + def __init__( + self, + *, + include: Optional[List["ConnectionMonitorEndpointScopeItem"]] = None, + exclude: Optional[List["ConnectionMonitorEndpointScopeItem"]] = None, + **kwargs + ): + super(ConnectionMonitorEndpointScope, self).__init__(**kwargs) + self.include = include + self.exclude = exclude + + +class ConnectionMonitorEndpointScopeItem(msrest.serialization.Model): + """Describes the connection monitor endpoint scope item. + + :param address: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + IPv4/IPv6 IP address. + :type address: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + *, + address: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorEndpointScopeItem, self).__init__(**kwargs) + self.address = address + + +class ConnectionMonitorHttpConfiguration(msrest.serialization.Model): + """Describes the HTTP configuration. + + :param port: The port to connect to. + :type port: int + :param method: The HTTP method to use. Possible values include: "Get", "Post". + :type method: str or ~azure.mgmt.network.v2020_07_01.models.HTTPConfigurationMethod + :param path: The path component of the URI. For instance, "/dir1/dir2". + :type path: str + :param request_headers: The HTTP headers to transmit with the request. + :type request_headers: list[~azure.mgmt.network.v2020_07_01.models.HTTPHeader] + :param valid_status_code_ranges: HTTP status codes to consider successful. For instance, + "2xx,301-304,418". + :type valid_status_code_ranges: list[str] + :param prefer_https: Value indicating whether HTTPS is preferred over HTTP in cases where the + choice is not explicit. + :type prefer_https: bool + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'int'}, + 'method': {'key': 'method', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'request_headers': {'key': 'requestHeaders', 'type': '[HTTPHeader]'}, + 'valid_status_code_ranges': {'key': 'validStatusCodeRanges', 'type': '[str]'}, + 'prefer_https': {'key': 'preferHTTPS', 'type': 'bool'}, + } + + def __init__( + self, + *, + port: Optional[int] = None, + method: Optional[Union[str, "HTTPConfigurationMethod"]] = None, + path: Optional[str] = None, + request_headers: Optional[List["HTTPHeader"]] = None, + valid_status_code_ranges: Optional[List[str]] = None, + prefer_https: Optional[bool] = None, + **kwargs + ): + super(ConnectionMonitorHttpConfiguration, self).__init__(**kwargs) + self.port = port + self.method = method + self.path = path + self.request_headers = request_headers + self.valid_status_code_ranges = valid_status_code_ranges + self.prefer_https = prefer_https + + +class ConnectionMonitorIcmpConfiguration(msrest.serialization.Model): + """Describes the ICMP configuration. + + :param disable_trace_route: Value indicating whether path evaluation with trace route should be + disabled. + :type disable_trace_route: bool + """ + + _attribute_map = { + 'disable_trace_route': {'key': 'disableTraceRoute', 'type': 'bool'}, + } + + def __init__( + self, + *, + disable_trace_route: Optional[bool] = None, + **kwargs + ): + super(ConnectionMonitorIcmpConfiguration, self).__init__(**kwargs) + self.disable_trace_route = disable_trace_route + + +class ConnectionMonitorListResult(msrest.serialization.Model): + """List of connection monitors. + + :param value: Information about connection monitors. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConnectionMonitorResult]'}, + } + + def __init__( + self, + *, + value: Optional[List["ConnectionMonitorResult"]] = None, + **kwargs + ): + super(ConnectionMonitorListResult, self).__init__(**kwargs) + self.value = value + + +class ConnectionMonitorOutput(msrest.serialization.Model): + """Describes a connection monitor output destination. + + :param type: Connection monitor output destination type. Currently, only "Workspace" is + supported. Possible values include: "Workspace". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.OutputType + :param workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :type workspace_settings: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorWorkspaceSettings + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_settings': {'key': 'workspaceSettings', 'type': 'ConnectionMonitorWorkspaceSettings'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "OutputType"]] = None, + workspace_settings: Optional["ConnectionMonitorWorkspaceSettings"] = None, + **kwargs + ): + super(ConnectionMonitorOutput, self).__init__(**kwargs) + self.type = type + self.workspace_settings = workspace_settings + + +class ConnectionMonitorParameters(msrest.serialization.Model): + """Parameters that define the operation to create a connection monitor. + + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _validation = { + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'notes', 'type': 'str'}, + } + + def __init__( + self, + *, + source: Optional["ConnectionMonitorSource"] = None, + destination: Optional["ConnectionMonitorDestination"] = None, + auto_start: Optional[bool] = True, + monitoring_interval_in_seconds: Optional[int] = 60, + endpoints: Optional[List["ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.endpoints = endpoints + self.test_configurations = test_configurations + self.test_groups = test_groups + self.outputs = outputs + self.notes = notes + + +class ConnectionMonitorQueryResult(msrest.serialization.Model): + """List of connection states snapshots. + + :param source_status: Status of connection monitor source. Possible values include: "Unknown", + "Active", "Inactive". + :type source_status: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSourceStatus + :param states: Information about connection states. + :type states: list[~azure.mgmt.network.v2020_07_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + 'source_status': {'key': 'sourceStatus', 'type': 'str'}, + 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, + } + + def __init__( + self, + *, + source_status: Optional[Union[str, "ConnectionMonitorSourceStatus"]] = None, + states: Optional[List["ConnectionStateSnapshot"]] = None, + **kwargs + ): + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.source_status = source_status + self.states = states + + +class ConnectionMonitorResult(msrest.serialization.Model): + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Connection monitor type. + :vartype type: str + :param location: Connection monitor location. + :type location: str + :param tags: A set of tags. Connection monitor tags. + :type tags: dict[str, str] + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + :ivar provisioning_state: The provisioning state of the connection monitor. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar start_time: The date and time when the connection monitor was started. + :vartype start_time: ~datetime.datetime + :ivar monitoring_status: The monitoring status of the connection monitor. + :vartype monitoring_status: str + :ivar connection_monitor_type: Type of connection monitor. Possible values include: + "MultiEndpoint", "SingleSourceDestination". + :vartype connection_monitor_type: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorType + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'monitoring_status': {'readonly': True}, + 'connection_monitor_type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'properties.endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'properties.testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'properties.testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'properties.outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + 'connection_monitor_type': {'key': 'properties.connectionMonitorType', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["ConnectionMonitorSource"] = None, + destination: Optional["ConnectionMonitorDestination"] = None, + auto_start: Optional[bool] = True, + monitoring_interval_in_seconds: Optional[int] = 60, + endpoints: Optional[List["ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = None + self.type = None + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.endpoints = endpoints + self.test_configurations = test_configurations + self.test_groups = test_groups + self.outputs = outputs + self.notes = notes + self.provisioning_state = None + self.start_time = None + self.monitoring_status = None + self.connection_monitor_type = None + + +class ConnectionMonitorResultProperties(ConnectionMonitorParameters): + """Describes the properties of a connection monitor. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param source: Describes the source of connection monitor. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start automatically once created. + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + :type monitoring_interval_in_seconds: int + :param endpoints: List of connection monitor endpoints. + :type endpoints: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + :ivar provisioning_state: The provisioning state of the connection monitor. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar start_time: The date and time when the connection monitor was started. + :vartype start_time: ~datetime.datetime + :ivar monitoring_status: The monitoring status of the connection monitor. + :vartype monitoring_status: str + :ivar connection_monitor_type: Type of connection monitor. Possible values include: + "MultiEndpoint", "SingleSourceDestination". + :vartype connection_monitor_type: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorType + """ + + _validation = { + 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'monitoring_status': {'readonly': True}, + 'connection_monitor_type': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + 'endpoints': {'key': 'endpoints', 'type': '[ConnectionMonitorEndpoint]'}, + 'test_configurations': {'key': 'testConfigurations', 'type': '[ConnectionMonitorTestConfiguration]'}, + 'test_groups': {'key': 'testGroups', 'type': '[ConnectionMonitorTestGroup]'}, + 'outputs': {'key': 'outputs', 'type': '[ConnectionMonitorOutput]'}, + 'notes': {'key': 'notes', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + 'connection_monitor_type': {'key': 'connectionMonitorType', 'type': 'str'}, + } + + def __init__( + self, + *, + source: Optional["ConnectionMonitorSource"] = None, + destination: Optional["ConnectionMonitorDestination"] = None, + auto_start: Optional[bool] = True, + monitoring_interval_in_seconds: Optional[int] = 60, + endpoints: Optional[List["ConnectionMonitorEndpoint"]] = None, + test_configurations: Optional[List["ConnectionMonitorTestConfiguration"]] = None, + test_groups: Optional[List["ConnectionMonitorTestGroup"]] = None, + outputs: Optional[List["ConnectionMonitorOutput"]] = None, + notes: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorResultProperties, self).__init__(source=source, destination=destination, auto_start=auto_start, monitoring_interval_in_seconds=monitoring_interval_in_seconds, endpoints=endpoints, test_configurations=test_configurations, test_groups=test_groups, outputs=outputs, notes=notes, **kwargs) + self.provisioning_state = None + self.start_time = None + self.monitoring_status = None + self.connection_monitor_type = None + + +class ConnectionMonitorSource(msrest.serialization.Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by connection monitor. + :type resource_id: str + :param port: The source port used by connection monitor. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + resource_id: str, + port: Optional[int] = None, + **kwargs + ): + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port + + +class ConnectionMonitorSuccessThreshold(msrest.serialization.Model): + """Describes the threshold for declaring a test successful. + + :param checks_failed_percent: The maximum percentage of failed checks permitted for a test to + evaluate as successful. + :type checks_failed_percent: int + :param round_trip_time_ms: The maximum round-trip time in milliseconds permitted for a test to + evaluate as successful. + :type round_trip_time_ms: float + """ + + _attribute_map = { + 'checks_failed_percent': {'key': 'checksFailedPercent', 'type': 'int'}, + 'round_trip_time_ms': {'key': 'roundTripTimeMs', 'type': 'float'}, + } + + def __init__( + self, + *, + checks_failed_percent: Optional[int] = None, + round_trip_time_ms: Optional[float] = None, + **kwargs + ): + super(ConnectionMonitorSuccessThreshold, self).__init__(**kwargs) + self.checks_failed_percent = checks_failed_percent + self.round_trip_time_ms = round_trip_time_ms + + +class ConnectionMonitorTcpConfiguration(msrest.serialization.Model): + """Describes the TCP configuration. + + :param port: The port to connect to. + :type port: int + :param disable_trace_route: Value indicating whether path evaluation with trace route should be + disabled. + :type disable_trace_route: bool + :param destination_port_behavior: Destination port behavior. Possible values include: "None", + "ListenIfAvailable". + :type destination_port_behavior: str or + ~azure.mgmt.network.v2020_07_01.models.DestinationPortBehavior + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'port': {'key': 'port', 'type': 'int'}, + 'disable_trace_route': {'key': 'disableTraceRoute', 'type': 'bool'}, + 'destination_port_behavior': {'key': 'destinationPortBehavior', 'type': 'str'}, + } + + def __init__( + self, + *, + port: Optional[int] = None, + disable_trace_route: Optional[bool] = None, + destination_port_behavior: Optional[Union[str, "DestinationPortBehavior"]] = None, + **kwargs + ): + super(ConnectionMonitorTcpConfiguration, self).__init__(**kwargs) + self.port = port + self.disable_trace_route = disable_trace_route + self.destination_port_behavior = destination_port_behavior + + +class ConnectionMonitorTestConfiguration(msrest.serialization.Model): + """Describes a connection monitor test configuration. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the connection monitor test configuration. + :type name: str + :param test_frequency_sec: The frequency of test evaluation, in seconds. + :type test_frequency_sec: int + :param protocol: Required. The protocol to use in test evaluation. Possible values include: + "Tcp", "Http", "Icmp". + :type protocol: str or + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTestConfigurationProtocol + :param preferred_ip_version: The preferred IP version to use in test evaluation. The connection + monitor may choose to use a different version depending on other parameters. Possible values + include: "IPv4", "IPv6". + :type preferred_ip_version: str or ~azure.mgmt.network.v2020_07_01.models.PreferredIPVersion + :param http_configuration: The parameters used to perform test evaluation over HTTP. + :type http_configuration: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorHttpConfiguration + :param tcp_configuration: The parameters used to perform test evaluation over TCP. + :type tcp_configuration: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorTcpConfiguration + :param icmp_configuration: The parameters used to perform test evaluation over ICMP. + :type icmp_configuration: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorIcmpConfiguration + :param success_threshold: The threshold for declaring a test successful. + :type success_threshold: + ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorSuccessThreshold + """ + + _validation = { + 'name': {'required': True}, + 'protocol': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'test_frequency_sec': {'key': 'testFrequencySec', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'preferred_ip_version': {'key': 'preferredIPVersion', 'type': 'str'}, + 'http_configuration': {'key': 'httpConfiguration', 'type': 'ConnectionMonitorHttpConfiguration'}, + 'tcp_configuration': {'key': 'tcpConfiguration', 'type': 'ConnectionMonitorTcpConfiguration'}, + 'icmp_configuration': {'key': 'icmpConfiguration', 'type': 'ConnectionMonitorIcmpConfiguration'}, + 'success_threshold': {'key': 'successThreshold', 'type': 'ConnectionMonitorSuccessThreshold'}, + } + + def __init__( + self, + *, + name: str, + protocol: Union[str, "ConnectionMonitorTestConfigurationProtocol"], + test_frequency_sec: Optional[int] = None, + preferred_ip_version: Optional[Union[str, "PreferredIPVersion"]] = None, + http_configuration: Optional["ConnectionMonitorHttpConfiguration"] = None, + tcp_configuration: Optional["ConnectionMonitorTcpConfiguration"] = None, + icmp_configuration: Optional["ConnectionMonitorIcmpConfiguration"] = None, + success_threshold: Optional["ConnectionMonitorSuccessThreshold"] = None, + **kwargs + ): + super(ConnectionMonitorTestConfiguration, self).__init__(**kwargs) + self.name = name + self.test_frequency_sec = test_frequency_sec + self.protocol = protocol + self.preferred_ip_version = preferred_ip_version + self.http_configuration = http_configuration + self.tcp_configuration = tcp_configuration + self.icmp_configuration = icmp_configuration + self.success_threshold = success_threshold + + +class ConnectionMonitorTestGroup(msrest.serialization.Model): + """Describes the connection monitor test group. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the connection monitor test group. + :type name: str + :param disable: Value indicating whether test group is disabled. + :type disable: bool + :param test_configurations: Required. List of test configuration names. + :type test_configurations: list[str] + :param sources: Required. List of source endpoint names. + :type sources: list[str] + :param destinations: Required. List of destination endpoint names. + :type destinations: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'test_configurations': {'required': True}, + 'sources': {'required': True}, + 'destinations': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disable': {'key': 'disable', 'type': 'bool'}, + 'test_configurations': {'key': 'testConfigurations', 'type': '[str]'}, + 'sources': {'key': 'sources', 'type': '[str]'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: str, + test_configurations: List[str], + sources: List[str], + destinations: List[str], + disable: Optional[bool] = None, + **kwargs + ): + super(ConnectionMonitorTestGroup, self).__init__(**kwargs) + self.name = name + self.disable = disable + self.test_configurations = test_configurations + self.sources = sources + self.destinations = destinations + + +class ConnectionMonitorWorkspaceSettings(msrest.serialization.Model): + """Describes the settings for producing output into a log analytics workspace. + + :param workspace_resource_id: Log analytics workspace resource ID. + :type workspace_resource_id: str + """ + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + workspace_resource_id: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorWorkspaceSettings, self).__init__(**kwargs) + self.workspace_resource_id = workspace_resource_id + + +class ConnectionResetSharedKey(msrest.serialization.Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared key length, should + between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__( + self, + *, + key_length: int, + **kwargs + ): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length + + +class ConnectionSharedKey(SubResource): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + value: str, + id: Optional[str] = None, + **kwargs + ): + super(ConnectionSharedKey, self).__init__(id=id, **kwargs) + self.value = value + + +class ConnectionStateSnapshot(msrest.serialization.Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param connection_state: The connection state. Possible values include: "Reachable", + "Unreachable", "Unknown". + :type connection_state: str or ~azure.mgmt.network.v2020_07_01.models.ConnectionState + :param start_time: The start time of the connection snapshot. + :type start_time: ~datetime.datetime + :param end_time: The end time of the connection snapshot. + :type end_time: ~datetime.datetime + :param evaluation_state: Connectivity analysis evaluation state. Possible values include: + "NotStarted", "InProgress", "Completed". + :type evaluation_state: str or ~azure.mgmt.network.v2020_07_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: long + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: long + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: long + :param probes_sent: The number of sent probes. + :type probes_sent: long + :param probes_failed: The number of failed probes. + :type probes_failed: long + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityHop] + """ + + _validation = { + 'avg_latency_in_ms': {'maximum': 4294967295, 'minimum': 0}, + 'min_latency_in_ms': {'maximum': 4294967295, 'minimum': 0}, + 'max_latency_in_ms': {'maximum': 4294967295, 'minimum': 0}, + 'probes_sent': {'maximum': 4294967295, 'minimum': 0}, + 'probes_failed': {'maximum': 4294967295, 'minimum': 0}, + 'hops': {'readonly': True}, + } + + _attribute_map = { + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'long'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'long'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'long'}, + 'probes_sent': {'key': 'probesSent', 'type': 'long'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'long'}, + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + } + + def __init__( + self, + *, + connection_state: Optional[Union[str, "ConnectionState"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + evaluation_state: Optional[Union[str, "EvaluationState"]] = None, + avg_latency_in_ms: Optional[int] = None, + min_latency_in_ms: Optional[int] = None, + max_latency_in_ms: Optional[int] = None, + probes_sent: Optional[int] = None, + probes_failed: Optional[int] = None, + **kwargs + ): + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = connection_state + self.start_time = start_time + self.end_time = end_time + self.evaluation_state = evaluation_state + self.avg_latency_in_ms = avg_latency_in_ms + self.min_latency_in_ms = min_latency_in_ms + self.max_latency_in_ms = max_latency_in_ms + self.probes_sent = probes_sent + self.probes_failed = probes_failed + self.hops = None + + +class ConnectivityDestination(msrest.serialization.Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _validation = { + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + address: Optional[str] = None, + port: Optional[int] = None, + **kwargs + ): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port + + +class ConnectivityHop(msrest.serialization.Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar previous_hop_ids: List of previous hop identifiers. + :vartype previous_hop_ids: list[str] + :ivar links: List of hop links. + :vartype links: list[~azure.mgmt.network.v2020_07_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2020_07_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'previous_hop_ids': {'readonly': True}, + 'links': {'readonly': True}, + 'previous_links': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'previous_hop_ids': {'key': 'previousHopIds', 'type': '[str]'}, + 'links': {'key': 'links', 'type': '[HopLink]'}, + 'previous_links': {'key': 'previousLinks', 'type': '[HopLink]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.previous_hop_ids = None + self.links = None + self.previous_links = None + self.issues = None + + +class ConnectivityInformation(msrest.serialization.Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: "Unknown", + "Connected", "Disconnected", "Degraded". + :vartype connection_status: str or ~azure.mgmt.network.v2020_07_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None + + +class ConnectivityIssue(msrest.serialization.Model): + """Information about an issue encountered in the process of checking for connectivity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the issue. Possible values include: "Local", "Inbound", "Outbound". + :vartype origin: str or ~azure.mgmt.network.v2020_07_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". + :vartype severity: str or ~azure.mgmt.network.v2020_07_01.models.Severity + :ivar type: The type of issue. Possible values include: "Unknown", "AgentStopped", + "GuestFirewall", "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", + "PortThrottled", "Platform". + :vartype type: str or ~azure.mgmt.network.v2020_07_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None + + +class ConnectivityParameters(msrest.serialization.Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the connection. + :type source: ~azure.mgmt.network.v2020_07_01.models.ConnectivitySource + :param destination: Required. The destination of connection. + :type destination: ~azure.mgmt.network.v2020_07_01.models.ConnectivityDestination + :param protocol: Network protocol. Possible values include: "Tcp", "Http", "Https", "Icmp". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.Protocol + :param protocol_configuration: Configuration of the protocol. + :type protocol_configuration: ~azure.mgmt.network.v2020_07_01.models.ProtocolConfiguration + :param preferred_ip_version: Preferred IP version of the connection. Possible values include: + "IPv4", "IPv6". + :type preferred_ip_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'protocol_configuration': {'key': 'protocolConfiguration', 'type': 'ProtocolConfiguration'}, + 'preferred_ip_version': {'key': 'preferredIPVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + source: "ConnectivitySource", + destination: "ConnectivityDestination", + protocol: Optional[Union[str, "Protocol"]] = None, + protocol_configuration: Optional["ProtocolConfiguration"] = None, + preferred_ip_version: Optional[Union[str, "IPVersion"]] = None, + **kwargs + ): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination + self.protocol = protocol + self.protocol_configuration = protocol_configuration + self.preferred_ip_version = preferred_ip_version + + +class ConnectivitySource(msrest.serialization.Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a connectivity check will be + initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + resource_id: str, + port: Optional[int] = None, + **kwargs + ): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port + + +class Container(SubResource): + """Reference to container resource in remote resource provider. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(Container, self).__init__(id=id, **kwargs) + + +class ContainerNetworkInterface(SubResource): + """Container network interface child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar container_network_interface_configuration: Container network interface configuration from + which this container network interface is created. + :vartype container_network_interface_configuration: + ~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterfaceConfiguration + :param container: Reference to the container to which this container network interface is + attached. + :type container: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterfaceIpConfiguration] + :ivar provisioning_state: The provisioning state of the container network interface resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'container_network_interface_configuration': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'container_network_interface_configuration': {'key': 'properties.containerNetworkInterfaceConfiguration', 'type': 'ContainerNetworkInterfaceConfiguration'}, + 'container': {'key': 'properties.container', 'type': 'SubResource'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[ContainerNetworkInterfaceIpConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + container: Optional["SubResource"] = None, + **kwargs + ): + super(ContainerNetworkInterface, self).__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.container_network_interface_configuration = None + self.container = container + self.ip_configurations = None + self.provisioning_state = None + + +class ContainerNetworkInterfaceConfiguration(SubResource): + """Container network interface configuration child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param ip_configurations: A list of ip configurations of the container network interface + configuration. + :type ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.IPConfigurationProfile] + :param container_network_interfaces: A list of container network interfaces created from this + container network interface configuration. + :type container_network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the container network interface + configuration resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfigurationProfile]'}, + 'container_network_interfaces': {'key': 'properties.containerNetworkInterfaces', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + ip_configurations: Optional[List["IPConfigurationProfile"]] = None, + container_network_interfaces: Optional[List["SubResource"]] = None, + **kwargs + ): + super(ContainerNetworkInterfaceConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.ip_configurations = ip_configurations + self.container_network_interfaces = container_network_interfaces + self.provisioning_state = None + + +class ContainerNetworkInterfaceIpConfiguration(msrest.serialization.Model): + """The ip configuration for a container network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the container network interface IP + configuration resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + super(ContainerNetworkInterfaceIpConfiguration, self).__init__(**kwargs) + self.name = name + self.type = None + self.etag = None + self.provisioning_state = None + + +class CustomDnsConfigPropertiesFormat(msrest.serialization.Model): + """Contains custom Dns resolution configuration from customer. + + :param fqdn: Fqdn that resolves to private endpoint ip address. + :type fqdn: str + :param ip_addresses: A list of private ip addresses of the private endpoint. + :type ip_addresses: list[str] + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + fqdn: Optional[str] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(CustomDnsConfigPropertiesFormat, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_addresses = ip_addresses + + +class CustomIpPrefix(Resource): + """Custom IP prefix resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :param cidr: The prefix range in CIDR notation. Should include the start address and the prefix + length. + :type cidr: str + :param commissioned_state: The commissioned state of the Custom IP Prefix. Possible values + include: "Provisioning", "Provisioned", "Commissioning", "Commissioned", "Decommissioning", + "Deprovisioning". + :type commissioned_state: str or ~azure.mgmt.network.v2020_07_01.models.CommissionedState + :ivar public_ip_prefixes: The list of all referenced PublicIpPrefixes. + :vartype public_ip_prefixes: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar resource_guid: The resource GUID property of the custom IP prefix resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the custom IP prefix resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'public_ip_prefixes': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'cidr': {'key': 'properties.cidr', 'type': 'str'}, + 'commissioned_state': {'key': 'properties.commissionedState', 'type': 'str'}, + 'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + cidr: Optional[str] = None, + commissioned_state: Optional[Union[str, "CommissionedState"]] = None, + **kwargs + ): + super(CustomIpPrefix, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.zones = zones + self.cidr = cidr + self.commissioned_state = commissioned_state + self.public_ip_prefixes = None + self.resource_guid = None + self.provisioning_state = None + + +class CustomIpPrefixListResult(msrest.serialization.Model): + """Response for ListCustomIpPrefixes API service call. + + :param value: A list of Custom IP prefixes that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CustomIpPrefix]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CustomIpPrefix"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(CustomIpPrefixListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DdosCustomPolicy(Resource): + """A DDoS custom policy in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the DDoS custom policy resource. It uniquely + identifies the resource, even if the user changes its name or migrate the resource across + subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DDoS custom policy resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar public_ip_addresses: The list of public IPs associated with the DDoS custom policy + resource. This list is read-only. + :vartype public_ip_addresses: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param protocol_custom_settings: The protocol-specific DDoS policy customization parameters. + :type protocol_custom_settings: + list[~azure.mgmt.network.v2020_07_01.models.ProtocolCustomSettingsFormat] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[SubResource]'}, + 'protocol_custom_settings': {'key': 'properties.protocolCustomSettings', 'type': '[ProtocolCustomSettingsFormat]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + protocol_custom_settings: Optional[List["ProtocolCustomSettingsFormat"]] = None, + **kwargs + ): + super(DdosCustomPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.resource_guid = None + self.provisioning_state = None + self.public_ip_addresses = None + self.protocol_custom_settings = protocol_custom_settings + + +class DdosProtectionPlan(msrest.serialization.Model): + """A DDoS protection plan in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar resource_guid: The resource GUID property of the DDoS protection plan resource. It + uniquely identifies the resource, even if the user changes its name or migrate the resource + across subscriptions or resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DDoS protection plan resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar virtual_networks: The list of virtual networks associated with the DDoS protection plan + resource. This list is read-only. + :vartype virtual_networks: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'virtual_networks': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DdosProtectionPlan, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.etag = None + self.resource_guid = None + self.provisioning_state = None + self.virtual_networks = None + + +class DdosProtectionPlanListResult(msrest.serialization.Model): + """A list of DDoS protection plans. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of DDoS protection plans. + :type value: list[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DdosProtectionPlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DdosProtectionPlan"]] = None, + **kwargs + ): + super(DdosProtectionPlanListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DdosSettings(msrest.serialization.Model): + """Contains the DDoS protection settings of the public IP. + + :param ddos_custom_policy: The DDoS custom policy associated with the public IP. + :type ddos_custom_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protection_coverage: The DDoS protection policy customizability of the public IP. Only + standard coverage will have the ability to be customized. Possible values include: "Basic", + "Standard". + :type protection_coverage: str or + ~azure.mgmt.network.v2020_07_01.models.DdosSettingsProtectionCoverage + :param protected_ip: Enables DDoS protection on the public IP. + :type protected_ip: bool + """ + + _attribute_map = { + 'ddos_custom_policy': {'key': 'ddosCustomPolicy', 'type': 'SubResource'}, + 'protection_coverage': {'key': 'protectionCoverage', 'type': 'str'}, + 'protected_ip': {'key': 'protectedIP', 'type': 'bool'}, + } + + def __init__( + self, + *, + ddos_custom_policy: Optional["SubResource"] = None, + protection_coverage: Optional[Union[str, "DdosSettingsProtectionCoverage"]] = None, + protected_ip: Optional[bool] = None, + **kwargs + ): + super(DdosSettings, self).__init__(**kwargs) + self.ddos_custom_policy = ddos_custom_policy + self.protection_coverage = protection_coverage + self.protected_ip = protected_ip + + +class Delegation(SubResource): + """Details the service to which the subnet is delegated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a subnet. This name can be used to + access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param service_name: The name of the service to whom the subnet should be delegated (e.g. + Microsoft.Sql/servers). + :type service_name: str + :ivar actions: The actions permitted to the service upon delegation. + :vartype actions: list[str] + :ivar provisioning_state: The provisioning state of the service delegation resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'actions': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + service_name: Optional[str] = None, + **kwargs + ): + super(Delegation, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.service_name = service_name + self.actions = None + self.provisioning_state = None + + +class DeviceProperties(msrest.serialization.Model): + """List of properties of the device. + + :param device_vendor: Name of the device Vendor. + :type device_vendor: str + :param device_model: Model of the device. + :type device_model: str + :param link_speed_in_mbps: Link speed. + :type link_speed_in_mbps: int + """ + + _attribute_map = { + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_model': {'key': 'deviceModel', 'type': 'str'}, + 'link_speed_in_mbps': {'key': 'linkSpeedInMbps', 'type': 'int'}, + } + + def __init__( + self, + *, + device_vendor: Optional[str] = None, + device_model: Optional[str] = None, + link_speed_in_mbps: Optional[int] = None, + **kwargs + ): + super(DeviceProperties, self).__init__(**kwargs) + self.device_vendor = device_vendor + self.device_model = device_model + self.link_speed_in_mbps = link_speed_in_mbps + + +class DhcpOptions(msrest.serialization.Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__( + self, + *, + dns_servers: Optional[List[str]] = None, + **kwargs + ): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers + + +class Dimension(msrest.serialization.Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + + +class DnsNameAvailabilityResult(msrest.serialization.Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__( + self, + *, + available: Optional[bool] = None, + **kwargs + ): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available + + +class DnsSettings(msrest.serialization.Model): + """DNS Proxy Settings in Firewall Policy. + + :param servers: List of Custom DNS Servers. + :type servers: list[str] + :param enable_proxy: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + :type enable_proxy: bool + :param require_proxy_for_network_rules: FQDNs in Network Rules are supported when set to true. + :type require_proxy_for_network_rules: bool + """ + + _attribute_map = { + 'servers': {'key': 'servers', 'type': '[str]'}, + 'enable_proxy': {'key': 'enableProxy', 'type': 'bool'}, + 'require_proxy_for_network_rules': {'key': 'requireProxyForNetworkRules', 'type': 'bool'}, + } + + def __init__( + self, + *, + servers: Optional[List[str]] = None, + enable_proxy: Optional[bool] = None, + require_proxy_for_network_rules: Optional[bool] = None, + **kwargs + ): + super(DnsSettings, self).__init__(**kwargs) + self.servers = servers + self.enable_proxy = enable_proxy + self.require_proxy_for_network_rules = require_proxy_for_network_rules + + +class DscpConfiguration(Resource): + """DSCP Configuration in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param markings: List of markings to be used in the configuration. + :type markings: list[int] + :param source_ip_ranges: Source IP ranges. + :type source_ip_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosIpRange] + :param destination_ip_ranges: Destination IP ranges. + :type destination_ip_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosIpRange] + :param source_port_ranges: Sources port ranges. + :type source_port_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosPortRange] + :param destination_port_ranges: Destination port ranges. + :type destination_port_ranges: list[~azure.mgmt.network.v2020_07_01.models.QosPortRange] + :param protocol: RNM supported protocol types. Possible values include: "DoNotUse", "Icmp", + "Tcp", "Udp", "Gre", "Esp", "Ah", "Vxlan", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ProtocolType + :ivar qos_collection_id: Qos Collection ID generated by RNM. + :vartype qos_collection_id: str + :ivar associated_network_interfaces: Associated Network Interfaces to the DSCP Configuration. + :vartype associated_network_interfaces: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar resource_guid: The resource GUID property of the DSCP Configuration resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the DSCP Configuration resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'qos_collection_id': {'readonly': True}, + 'associated_network_interfaces': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'markings': {'key': 'properties.markings', 'type': '[int]'}, + 'source_ip_ranges': {'key': 'properties.sourceIpRanges', 'type': '[QosIpRange]'}, + 'destination_ip_ranges': {'key': 'properties.destinationIpRanges', 'type': '[QosIpRange]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[QosPortRange]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[QosPortRange]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'qos_collection_id': {'key': 'properties.qosCollectionId', 'type': 'str'}, + 'associated_network_interfaces': {'key': 'properties.associatedNetworkInterfaces', 'type': '[NetworkInterface]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + markings: Optional[List[int]] = None, + source_ip_ranges: Optional[List["QosIpRange"]] = None, + destination_ip_ranges: Optional[List["QosIpRange"]] = None, + source_port_ranges: Optional[List["QosPortRange"]] = None, + destination_port_ranges: Optional[List["QosPortRange"]] = None, + protocol: Optional[Union[str, "ProtocolType"]] = None, + **kwargs + ): + super(DscpConfiguration, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.markings = markings + self.source_ip_ranges = source_ip_ranges + self.destination_ip_ranges = destination_ip_ranges + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.protocol = protocol + self.qos_collection_id = None + self.associated_network_interfaces = None + self.resource_guid = None + self.provisioning_state = None + + +class DscpConfigurationListResult(msrest.serialization.Model): + """Response for the DscpConfigurationList API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of dscp configurations in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.DscpConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscpConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DscpConfiguration"]] = None, + **kwargs + ): + super(DscpConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class EffectiveNetworkSecurityGroup(msrest.serialization.Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is applied. + :type network_security_group: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within the tag. + :type tag_map: str + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': 'str'}, + } + + def __init__( + self, + *, + network_security_group: Optional["SubResource"] = None, + association: Optional["EffectiveNetworkSecurityGroupAssociation"] = None, + effective_security_rules: Optional[List["EffectiveNetworkSecurityRule"]] = None, + tag_map: Optional[str] = None, + **kwargs + ): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map + + +class EffectiveNetworkSecurityGroupAssociation(msrest.serialization.Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + subnet: Optional["SubResource"] = None, + network_interface: Optional["SubResource"] = None, + **kwargs + ): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface + + +class EffectiveNetworkSecurityGroupListResult(msrest.serialization.Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of effective network security groups. + :type value: list[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EffectiveNetworkSecurityGroup"]] = None, + **kwargs + ): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class EffectiveNetworkSecurityRule(msrest.serialization.Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible values include: "Tcp", + "Udp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include a single integer + between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected values include a single + integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected values include CIDR IP + ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the + asterisk (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. Expected values include + CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and + the asterisk (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible values include: "Allow", + "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values include: "Inbound", "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + protocol: Optional[Union[str, "EffectiveSecurityRuleProtocol"]] = None, + source_port_range: Optional[str] = None, + destination_port_range: Optional[str] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + source_address_prefix: Optional[str] = None, + destination_address_prefix: Optional[str] = None, + source_address_prefixes: Optional[List[str]] = None, + destination_address_prefixes: Optional[List[str]] = None, + expanded_source_address_prefix: Optional[List[str]] = None, + expanded_destination_address_prefix: Optional[List[str]] = None, + access: Optional[Union[str, "SecurityRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "SecurityRuleDirection"]] = None, + **kwargs + ): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction + + +class EffectiveRoute(msrest.serialization.Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param disable_bgp_route_propagation: If true, on-premises routes are not propagated to the + network interfaces in the subnet. + :type disable_bgp_route_propagation: bool + :param source: Who created the route. Possible values include: "Unknown", "User", + "VirtualNetworkGateway", "Default". + :type source: str or ~azure.mgmt.network.v2020_07_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values include: "Active", "Invalid". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values + include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". + :type next_hop_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disable_bgp_route_propagation': {'key': 'disableBgpRoutePropagation', 'type': 'bool'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + disable_bgp_route_propagation: Optional[bool] = None, + source: Optional[Union[str, "EffectiveRouteSource"]] = None, + state: Optional[Union[str, "EffectiveRouteState"]] = None, + address_prefix: Optional[List[str]] = None, + next_hop_ip_address: Optional[List[str]] = None, + next_hop_type: Optional[Union[str, "RouteNextHopType"]] = None, + **kwargs + ): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type + + +class EffectiveRouteListResult(msrest.serialization.Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2020_07_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EffectiveRoute"]] = None, + **kwargs + ): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class EffectiveRoutesParameters(msrest.serialization.Model): + """The parameters specifying the resource whose effective routes are being requested. + + :param resource_id: The resource whose effective routes are being requested. + :type resource_id: str + :param virtual_wan_resource_type: The type of the specified resource like RouteTable, + ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + :type virtual_wan_resource_type: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'virtual_wan_resource_type': {'key': 'virtualWanResourceType', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + virtual_wan_resource_type: Optional[str] = None, + **kwargs + ): + super(EffectiveRoutesParameters, self).__init__(**kwargs) + self.resource_id = resource_id + self.virtual_wan_resource_type = virtual_wan_resource_type + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None + + +class EndpointServicesListResult(msrest.serialization.Model): + """Response for the ListAvailableEndpointServices API service call. + + :param value: List of available endpoint services in a region. + :type value: list[~azure.mgmt.network.v2020_07_01.models.EndpointServiceResult] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EndpointServiceResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EndpointServiceResult"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(EndpointServicesListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Error(msrest.serialization.Model): + """Common error representation. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :param target: Error target. + :type target: str + :param details: Error details. + :type details: list[~azure.mgmt.network.v2020_07_01.models.ErrorDetails] + :param inner_error: Inner error message. + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ErrorDetails"]] = None, + inner_error: Optional[str] = None, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error + + +class ErrorDetails(msrest.serialization.Model): + """Common error details representation. + + :param code: Error code. + :type code: str + :param target: Error target. + :type target: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message + + +class ErrorResponse(msrest.serialization.Model): + """The error object. + + :param error: The error details object. + :type error: ~azure.mgmt.network.v2020_07_01.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetails"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class EvaluatedNetworkSecurityGroup(msrest.serialization.Model): + """Results of network security group evaluation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param network_security_group_id: Network security group ID. + :type network_security_group_id: str + :param applied_to: Resource ID of nic or subnet to which network security group is applied. + :type applied_to: str + :param matched_rule: Matched network security rule. + :type matched_rule: ~azure.mgmt.network.v2020_07_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityRulesEvaluationResult] + """ + + _validation = { + 'rules_evaluation_result': {'readonly': True}, + } + + _attribute_map = { + 'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'}, + 'applied_to': {'key': 'appliedTo', 'type': 'str'}, + 'matched_rule': {'key': 'matchedRule', 'type': 'MatchedRule'}, + 'rules_evaluation_result': {'key': 'rulesEvaluationResult', 'type': '[NetworkSecurityRulesEvaluationResult]'}, + } + + def __init__( + self, + *, + network_security_group_id: Optional[str] = None, + applied_to: Optional[str] = None, + matched_rule: Optional["MatchedRule"] = None, + **kwargs + ): + super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group_id = network_security_group_id + self.applied_to = applied_to + self.matched_rule = matched_rule + self.rules_evaluation_result = None + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param allow_classic_operations: Allow classic operations. + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The ServiceProviderProvisioningState state of the + resource. Possible values include: "NotProvisioned", "Provisioning", "Provisioned", + "Deprovisioning". + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2020_07_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitServiceProviderProperties + :param express_route_port: The reference to the ExpressRoutePort resource when the circuit is + provisioned on an ExpressRoutePort resource. + :type express_route_port: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param bandwidth_in_gbps: The bandwidth of the circuit when the circuit is provisioned on an + ExpressRoutePort resource. + :type bandwidth_in_gbps: float + :ivar stag: The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + :vartype stag: int + :ivar provisioning_state: The provisioning state of the express route circuit resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param global_reach_enabled: Flag denoting global reach status. + :type global_reach_enabled: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'stag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'express_route_port': {'key': 'properties.expressRoutePort', 'type': 'SubResource'}, + 'bandwidth_in_gbps': {'key': 'properties.bandwidthInGbps', 'type': 'float'}, + 'stag': {'key': 'properties.stag', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'global_reach_enabled': {'key': 'properties.globalReachEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ExpressRouteCircuitSku"] = None, + allow_classic_operations: Optional[bool] = None, + circuit_provisioning_state: Optional[str] = None, + service_provider_provisioning_state: Optional[Union[str, "ServiceProviderProvisioningState"]] = None, + authorizations: Optional[List["ExpressRouteCircuitAuthorization"]] = None, + peerings: Optional[List["ExpressRouteCircuitPeering"]] = None, + service_key: Optional[str] = None, + service_provider_notes: Optional[str] = None, + service_provider_properties: Optional["ExpressRouteCircuitServiceProviderProperties"] = None, + express_route_port: Optional["SubResource"] = None, + bandwidth_in_gbps: Optional[float] = None, + gateway_manager_etag: Optional[str] = None, + global_reach_enabled: Optional[bool] = None, + **kwargs + ): + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.etag = None + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.express_route_port = express_route_port + self.bandwidth_in_gbps = bandwidth_in_gbps + self.stag = None + self.provisioning_state = None + self.gateway_manager_etag = gateway_manager_etag + self.global_reach_enabled = global_reach_enabled + + +class ExpressRouteCircuitArpTable(msrest.serialization.Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Entry age in minutes. + :type age: int + :param interface: Interface address. + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + age: Optional[int] = None, + interface: Optional[str] = None, + ip_address: Optional[str] = None, + mac_address: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: The authorization use status. Possible values include: + "Available", "InUse". + :type authorization_use_status: str or + ~azure.mgmt.network.v2020_07_01.models.AuthorizationUseStatus + :ivar provisioning_state: The provisioning state of the authorization resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + authorization_key: Optional[str] = None, + authorization_use_status: Optional[Union[str, "AuthorizationUseStatus"]] = None, + **kwargs + ): + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = None + + +class ExpressRouteCircuitConnection(SubResource): + """Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit initiating connection. + :type express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :type peer_express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :type address_prefix: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param ipv6_circuit_connection_config: IPv6 Address PrefixProperties of the express route + circuit connection. + :type ipv6_circuit_connection_config: + ~azure.mgmt.network.v2020_07_01.models.Ipv6CircuitConnectionConfig + :ivar circuit_connection_status: Express Route Circuit connection state. Possible values + include: "Connected", "Connecting", "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.CircuitConnectionStatus + :ivar provisioning_state: The provisioning state of the express route circuit connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'express_route_circuit_peering': {'key': 'properties.expressRouteCircuitPeering', 'type': 'SubResource'}, + 'peer_express_route_circuit_peering': {'key': 'properties.peerExpressRouteCircuitPeering', 'type': 'SubResource'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'ipv6_circuit_connection_config': {'key': 'properties.ipv6CircuitConnectionConfig', 'type': 'Ipv6CircuitConnectionConfig'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + express_route_circuit_peering: Optional["SubResource"] = None, + peer_express_route_circuit_peering: Optional["SubResource"] = None, + address_prefix: Optional[str] = None, + authorization_key: Optional[str] = None, + ipv6_circuit_connection_config: Optional["Ipv6CircuitConnectionConfig"] = None, + **kwargs + ): + super(ExpressRouteCircuitConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.express_route_circuit_peering = express_route_circuit_peering + self.peer_express_route_circuit_peering = peer_express_route_circuit_peering + self.address_prefix = address_prefix + self.authorization_key = authorization_key + self.ipv6_circuit_connection_config = ipv6_circuit_connection_config + self.circuit_connection_status = None + self.provisioning_state = None + + +class ExpressRouteCircuitConnectionListResult(msrest.serialization.Model): + """Response for ListConnections API service call retrieves all global reach connections that belongs to a Private Peering for an ExpressRouteCircuit. + + :param value: The global reach connection associated with Private Peering in an ExpressRoute + Circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuitConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitListResult(msrest.serialization.Model): + """Response for ListExpressRouteCircuit API service call. + + :param value: A list of ExpressRouteCircuits in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuit]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuit"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param peering_type: The peering type. Possible values include: "AzurePublicPeering", + "AzurePrivatePeering", "MicrosoftPeering". + :type peering_type: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringConfig + :param stats: The peering stats of express route circuit. + :type stats: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitStats + :ivar provisioning_state: The provisioning state of the express route circuit peering resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar last_modified_by: Who was the last to modify the peering. + :vartype last_modified_by: str + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_07_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param express_route_connection: The ExpressRoute connection. + :type express_route_connection: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnectionId + :param connections: The list of circuit connections associated with Azure Private Peering for + this circuit. + :type connections: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection] + :ivar peered_connections: The list of peered circuit connections associated with Azure Private + Peering for this circuit. + :vartype peered_connections: + list[~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnection] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'provisioning_state': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'peered_connections': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'SubResource'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'express_route_connection': {'key': 'properties.expressRouteConnection', 'type': 'ExpressRouteConnectionId'}, + 'connections': {'key': 'properties.connections', 'type': '[ExpressRouteCircuitConnection]'}, + 'peered_connections': {'key': 'properties.peeredConnections', 'type': '[PeerExpressRouteCircuitConnection]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + peering_type: Optional[Union[str, "ExpressRoutePeeringType"]] = None, + state: Optional[Union[str, "ExpressRoutePeeringState"]] = None, + azure_asn: Optional[int] = None, + peer_asn: Optional[int] = None, + primary_peer_address_prefix: Optional[str] = None, + secondary_peer_address_prefix: Optional[str] = None, + primary_azure_port: Optional[str] = None, + secondary_azure_port: Optional[str] = None, + shared_key: Optional[str] = None, + vlan_id: Optional[int] = None, + microsoft_peering_config: Optional["ExpressRouteCircuitPeeringConfig"] = None, + stats: Optional["ExpressRouteCircuitStats"] = None, + gateway_manager_etag: Optional[str] = None, + route_filter: Optional["SubResource"] = None, + ipv6_peering_config: Optional["Ipv6ExpressRouteCircuitPeeringConfig"] = None, + express_route_connection: Optional["ExpressRouteConnectionId"] = None, + connections: Optional[List["ExpressRouteCircuitConnection"]] = None, + **kwargs + ): + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = None + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = None + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.express_route_connection = express_route_connection + self.connections = connections + self.peered_connections = None + + +class ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): + """Specifies the peering configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param advertised_public_prefixes: The reference to AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Specified for microsoft peering. + :type advertised_communities: list[str] + :ivar advertised_public_prefixes_state: The advertised public prefix state of the Peering + resource. Possible values include: "NotConfigured", "Configuring", "Configured", + "ValidationNeeded". + :vartype advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the configuration. + :type routing_registry_name: str + """ + + _validation = { + 'advertised_public_prefixes_state': {'readonly': True}, + } + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__( + self, + *, + advertised_public_prefixes: Optional[List[str]] = None, + advertised_communities: Optional[List[str]] = None, + legacy_mode: Optional[int] = None, + customer_asn: Optional[int] = None, + routing_registry_name: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = None + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name + + +class ExpressRouteCircuitPeeringId(msrest.serialization.Model): + """ExpressRoute circuit peering identifier. + + :param id: The ID of the ExpressRoute circuit peering. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitPeeringId, self).__init__(**kwargs) + self.id = id + + +class ExpressRouteCircuitPeeringListResult(msrest.serialization.Model): + """Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. + + :param value: The peerings in an express route circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuitPeering"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitPeeringListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitReference(msrest.serialization.Model): + """Reference to an express route circuit. + + :param id: Corresponding Express Route Circuit Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitReference, self).__init__(**kwargs) + self.id = id + + +class ExpressRouteCircuitRoutesTable(msrest.serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: IP address of a network entity. + :type network: str + :param next_hop: NextHop address. + :type next_hop: str + :param loc_prf: Local preference value as set with the set local-preference route-map + configuration command. + :type loc_prf: str + :param weight: Route Weight. + :type weight: int + :param path: Autonomous system paths to the destination network. + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + *, + network: Optional[str] = None, + next_hop: Optional[str] = None, + loc_prf: Optional[str] = None, + weight: Optional[int] = None, + path: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path + + +class ExpressRouteCircuitRoutesTableSummary(msrest.serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: IP address of the neighbor. + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of prefixes that have + been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__( + self, + *, + neighbor: Optional[str] = None, + v: Optional[int] = None, + as_property: Optional[int] = None, + up_down: Optional[str] = None, + state_pfx_rcd: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd + + +class ExpressRouteCircuitsArpTableListResult(msrest.serialization.Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: A list of the ARP tables. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuitArpTable"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitServiceProviderProperties(msrest.serialization.Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__( + self, + *, + service_provider_name: Optional[str] = None, + peering_location: Optional[str] = None, + bandwidth_in_mbps: Optional[int] = None, + **kwargs + ): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps + + +class ExpressRouteCircuitSku(msrest.serialization.Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values include: "Standard", "Premium", "Basic", + "Local". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values include: "UnlimitedData", "MeteredData". + :type family: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[Union[str, "ExpressRouteCircuitSkuTier"]] = None, + family: Optional[Union[str, "ExpressRouteCircuitSkuFamily"]] = None, + **kwargs + ): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family + + +class ExpressRouteCircuitsRoutesTableListResult(msrest.serialization.Model): + """Response for ListRoutesTable associated with the Express Route Circuits API. + + :param value: The list of routes table. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuitRoutesTable"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(msrest.serialization.Model): + """Response for ListRoutesTable associated with the Express Route Circuits API. + + :param value: A list of the routes table. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCircuitRoutesTableSummary"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteCircuitStats(msrest.serialization.Model): + """Contains stats associated with the peering. + + :param primarybytes_in: The Primary BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: The primary BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: The secondary BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: The secondary BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__( + self, + *, + primarybytes_in: Optional[int] = None, + primarybytes_out: Optional[int] = None, + secondarybytes_in: Optional[int] = None, + secondarybytes_out: Optional[int] = None, + **kwargs + ): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out + + +class ExpressRouteConnection(SubResource): + """ExpressRouteConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param name: Required. The name of the resource. + :type name: str + :ivar provisioning_state: The provisioning state of the express route connection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param express_route_circuit_peering: The ExpressRoute circuit peering. + :type express_route_circuit_peering: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringId + :param authorization_key: Authorization key to establish the connection. + :type authorization_key: str + :param routing_weight: The routing weight associated to the connection. + :type routing_weight: int + :param enable_internet_security: Enable internet security. + :type enable_internet_security: bool + :param express_route_gateway_bypass: Enable FastPath to vWan Firewall hub. + :type express_route_gateway_bypass: bool + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + """ + + _validation = { + 'name': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_circuit_peering': {'key': 'properties.expressRouteCircuitPeering', 'type': 'ExpressRouteCircuitPeeringId'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'express_route_gateway_bypass': {'key': 'properties.expressRouteGatewayBypass', 'type': 'bool'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + } + + def __init__( + self, + *, + name: str, + id: Optional[str] = None, + express_route_circuit_peering: Optional["ExpressRouteCircuitPeeringId"] = None, + authorization_key: Optional[str] = None, + routing_weight: Optional[int] = None, + enable_internet_security: Optional[bool] = None, + express_route_gateway_bypass: Optional[bool] = None, + routing_configuration: Optional["RoutingConfiguration"] = None, + **kwargs + ): + super(ExpressRouteConnection, self).__init__(id=id, **kwargs) + self.name = name + self.provisioning_state = None + self.express_route_circuit_peering = express_route_circuit_peering + self.authorization_key = authorization_key + self.routing_weight = routing_weight + self.enable_internet_security = enable_internet_security + self.express_route_gateway_bypass = express_route_gateway_bypass + self.routing_configuration = routing_configuration + + +class ExpressRouteConnectionId(msrest.serialization.Model): + """The ID of the ExpressRouteConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the ExpressRouteConnection. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRouteConnectionId, self).__init__(**kwargs) + self.id = None + + +class ExpressRouteConnectionList(msrest.serialization.Model): + """ExpressRouteConnection list. + + :param value: The list of ExpressRoute connections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteConnection"]] = None, + **kwargs + ): + super(ExpressRouteConnectionList, self).__init__(**kwargs) + self.value = value + + +class ExpressRouteCrossConnection(Resource): + """ExpressRouteCrossConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar primary_azure_port: The name of the primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The name of the secondary port. + :vartype secondary_azure_port: str + :ivar s_tag: The identifier of the circuit traffic. + :vartype s_tag: int + :ivar peering_location: The peering location of the ExpressRoute circuit. + :vartype peering_location: str + :ivar bandwidth_in_mbps: The circuit bandwidth In Mbps. + :vartype bandwidth_in_mbps: int + :param express_route_circuit: The ExpressRouteCircuit. + :type express_route_circuit: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitReference + :param service_provider_provisioning_state: The provisioning state of the circuit in the + connectivity provider system. Possible values include: "NotProvisioned", "Provisioning", + "Provisioned", "Deprovisioning". + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2020_07_01.models.ServiceProviderProvisioningState + :param service_provider_notes: Additional read only notes set by the connectivity provider. + :type service_provider_notes: str + :ivar provisioning_state: The provisioning state of the express route cross connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'primary_azure_port': {'readonly': True}, + 'secondary_azure_port': {'readonly': True}, + 's_tag': {'readonly': True}, + 'peering_location': {'readonly': True}, + 'bandwidth_in_mbps': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 's_tag': {'key': 'properties.sTag', 'type': 'int'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'properties.bandwidthInMbps', 'type': 'int'}, + 'express_route_circuit': {'key': 'properties.expressRouteCircuit', 'type': 'ExpressRouteCircuitReference'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCrossConnectionPeering]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + express_route_circuit: Optional["ExpressRouteCircuitReference"] = None, + service_provider_provisioning_state: Optional[Union[str, "ServiceProviderProvisioningState"]] = None, + service_provider_notes: Optional[str] = None, + peerings: Optional[List["ExpressRouteCrossConnectionPeering"]] = None, + **kwargs + ): + super(ExpressRouteCrossConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.primary_azure_port = None + self.secondary_azure_port = None + self.s_tag = None + self.peering_location = None + self.bandwidth_in_mbps = None + self.express_route_circuit = express_route_circuit + self.service_provider_provisioning_state = service_provider_provisioning_state + self.service_provider_notes = service_provider_notes + self.provisioning_state = None + self.peerings = peerings + + +class ExpressRouteCrossConnectionListResult(msrest.serialization.Model): + """Response for ListExpressRouteCrossConnection API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of ExpressRouteCrossConnection resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCrossConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCrossConnection"]] = None, + **kwargs + ): + super(ExpressRouteCrossConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteCrossConnectionPeering(SubResource): + """Peering in an ExpressRoute Cross Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param peering_type: The peering type. Possible values include: "AzurePublicPeering", + "AzurePrivatePeering", "MicrosoftPeering". + :type peering_type: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePeeringState + :ivar azure_asn: The Azure ASN. + :vartype azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :ivar primary_azure_port: The primary port. + :vartype primary_azure_port: str + :ivar secondary_azure_port: The secondary port. + :vartype secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringConfig + :ivar provisioning_state: The provisioning state of the express route cross connection peering + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar last_modified_by: Who was the last to modify the peering. + :vartype last_modified_by: str + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_07_01.models.Ipv6ExpressRouteCircuitPeeringConfig + """ + + _validation = { + 'etag': {'readonly': True}, + 'azure_asn': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'primary_azure_port': {'readonly': True}, + 'secondary_azure_port': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + peering_type: Optional[Union[str, "ExpressRoutePeeringType"]] = None, + state: Optional[Union[str, "ExpressRoutePeeringState"]] = None, + peer_asn: Optional[int] = None, + primary_peer_address_prefix: Optional[str] = None, + secondary_peer_address_prefix: Optional[str] = None, + shared_key: Optional[str] = None, + vlan_id: Optional[int] = None, + microsoft_peering_config: Optional["ExpressRouteCircuitPeeringConfig"] = None, + gateway_manager_etag: Optional[str] = None, + ipv6_peering_config: Optional["Ipv6ExpressRouteCircuitPeeringConfig"] = None, + **kwargs + ): + super(ExpressRouteCrossConnectionPeering, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.peering_type = peering_type + self.state = state + self.azure_asn = None + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = None + self.secondary_azure_port = None + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.provisioning_state = None + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = None + self.ipv6_peering_config = ipv6_peering_config + + +class ExpressRouteCrossConnectionPeeringList(msrest.serialization.Model): + """Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The peerings in an express route cross connection. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCrossConnectionPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCrossConnectionPeering"]] = None, + **kwargs + ): + super(ExpressRouteCrossConnectionPeeringList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteCrossConnectionRoutesTableSummary(msrest.serialization.Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: IP address of Neighbor router. + :type neighbor: str + :param asn: Autonomous system number. + :type asn: int + :param up_down: The length of time that the BGP session has been in the Established state, or + the current status if not in the Established state. + :type up_down: str + :param state_or_prefixes_received: Current state of the BGP session, and the number of prefixes + that have been received from a neighbor or peer group. + :type state_or_prefixes_received: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_or_prefixes_received': {'key': 'stateOrPrefixesReceived', 'type': 'str'}, + } + + def __init__( + self, + *, + neighbor: Optional[str] = None, + asn: Optional[int] = None, + up_down: Optional[str] = None, + state_or_prefixes_received: Optional[str] = None, + **kwargs + ): + super(ExpressRouteCrossConnectionRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.asn = asn + self.up_down = up_down + self.state_or_prefixes_received = state_or_prefixes_received + + +class ExpressRouteCrossConnectionsRoutesTableSummaryListResult(msrest.serialization.Model): + """Response for ListRoutesTable associated with the Express Route Cross Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionRoutesTableSummary] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCrossConnectionRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteCrossConnectionRoutesTableSummary"]] = None, + **kwargs + ): + super(ExpressRouteCrossConnectionsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ExpressRouteGateway(Resource): + """ExpressRoute gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param auto_scale_configuration: Configuration for auto scaling. + :type auto_scale_configuration: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection] + :ivar provisioning_state: The provisioning state of the express route gateway resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param virtual_hub: The Virtual Hub where the ExpressRoute gateway is or will be deployed. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.VirtualHubId + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'express_route_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'auto_scale_configuration': {'key': 'properties.autoScaleConfiguration', 'type': 'ExpressRouteGatewayPropertiesAutoScaleConfiguration'}, + 'express_route_connections': {'key': 'properties.expressRouteConnections', 'type': '[ExpressRouteConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'VirtualHubId'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + auto_scale_configuration: Optional["ExpressRouteGatewayPropertiesAutoScaleConfiguration"] = None, + virtual_hub: Optional["VirtualHubId"] = None, + **kwargs + ): + super(ExpressRouteGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.auto_scale_configuration = auto_scale_configuration + self.express_route_connections = None + self.provisioning_state = None + self.virtual_hub = virtual_hub + + +class ExpressRouteGatewayList(msrest.serialization.Model): + """List of ExpressRoute gateways. + + :param value: List of ExpressRoute gateways. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteGateway]'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteGateway"]] = None, + **kwargs + ): + super(ExpressRouteGatewayList, self).__init__(**kwargs) + self.value = value + + +class ExpressRouteGatewayPropertiesAutoScaleConfiguration(msrest.serialization.Model): + """Configuration for auto scaling. + + :param bounds: Minimum and maximum number of scale units to deploy. + :type bounds: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + """ + + _attribute_map = { + 'bounds': {'key': 'bounds', 'type': 'ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds'}, + } + + def __init__( + self, + *, + bounds: Optional["ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds"] = None, + **kwargs + ): + super(ExpressRouteGatewayPropertiesAutoScaleConfiguration, self).__init__(**kwargs) + self.bounds = bounds + + +class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds(msrest.serialization.Model): + """Minimum and maximum number of scale units to deploy. + + :param min: Minimum number of scale units deployed for ExpressRoute gateway. + :type min: int + :param max: Maximum number of scale units deployed for ExpressRoute gateway. + :type max: int + """ + + _attribute_map = { + 'min': {'key': 'min', 'type': 'int'}, + 'max': {'key': 'max', 'type': 'int'}, + } + + def __init__( + self, + *, + min: Optional[int] = None, + max: Optional[int] = None, + **kwargs + ): + super(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds, self).__init__(**kwargs) + self.min = min + self.max = max + + +class ExpressRouteLink(SubResource): + """ExpressRouteLink child resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of child port resource that is unique among child port resources of the + parent. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar router_name: Name of Azure router associated with physical port. + :vartype router_name: str + :ivar interface_name: Name of Azure router interface. + :vartype interface_name: str + :ivar patch_panel_id: Mapping between physical port to patch panel port. + :vartype patch_panel_id: str + :ivar rack_id: Mapping of physical patch panel to rack. + :vartype rack_id: str + :ivar connector_type: Physical fiber port type. Possible values include: "LC", "SC". + :vartype connector_type: str or + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkConnectorType + :param admin_state: Administrative state of the physical port. Possible values include: + "Enabled", "Disabled". + :type admin_state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkAdminState + :ivar provisioning_state: The provisioning state of the express route link resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param mac_sec_config: MacSec configuration. + :type mac_sec_config: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkMacSecConfig + """ + + _validation = { + 'etag': {'readonly': True}, + 'router_name': {'readonly': True}, + 'interface_name': {'readonly': True}, + 'patch_panel_id': {'readonly': True}, + 'rack_id': {'readonly': True}, + 'connector_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'router_name': {'key': 'properties.routerName', 'type': 'str'}, + 'interface_name': {'key': 'properties.interfaceName', 'type': 'str'}, + 'patch_panel_id': {'key': 'properties.patchPanelId', 'type': 'str'}, + 'rack_id': {'key': 'properties.rackId', 'type': 'str'}, + 'connector_type': {'key': 'properties.connectorType', 'type': 'str'}, + 'admin_state': {'key': 'properties.adminState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'mac_sec_config': {'key': 'properties.macSecConfig', 'type': 'ExpressRouteLinkMacSecConfig'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + admin_state: Optional[Union[str, "ExpressRouteLinkAdminState"]] = None, + mac_sec_config: Optional["ExpressRouteLinkMacSecConfig"] = None, + **kwargs + ): + super(ExpressRouteLink, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.router_name = None + self.interface_name = None + self.patch_panel_id = None + self.rack_id = None + self.connector_type = None + self.admin_state = admin_state + self.provisioning_state = None + self.mac_sec_config = mac_sec_config + + +class ExpressRouteLinkListResult(msrest.serialization.Model): + """Response for ListExpressRouteLinks API service call. + + :param value: The list of ExpressRouteLink sub-resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteLink] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteLink"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteLinkListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteLinkMacSecConfig(msrest.serialization.Model): + """ExpressRouteLink Mac Security Configuration. + + :param ckn_secret_identifier: Keyvault Secret Identifier URL containing Mac security CKN key. + :type ckn_secret_identifier: str + :param cak_secret_identifier: Keyvault Secret Identifier URL containing Mac security CAK key. + :type cak_secret_identifier: str + :param cipher: Mac security cipher. Possible values include: "GcmAes256", "GcmAes128", + "GcmAesXpn128", "GcmAesXpn256". + :type cipher: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkMacSecCipher + :param sci_state: Sci mode enabled/disabled. Possible values include: "Disabled", "Enabled". + :type sci_state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkMacSecSciState + """ + + _attribute_map = { + 'ckn_secret_identifier': {'key': 'cknSecretIdentifier', 'type': 'str'}, + 'cak_secret_identifier': {'key': 'cakSecretIdentifier', 'type': 'str'}, + 'cipher': {'key': 'cipher', 'type': 'str'}, + 'sci_state': {'key': 'sciState', 'type': 'str'}, + } + + def __init__( + self, + *, + ckn_secret_identifier: Optional[str] = None, + cak_secret_identifier: Optional[str] = None, + cipher: Optional[Union[str, "ExpressRouteLinkMacSecCipher"]] = None, + sci_state: Optional[Union[str, "ExpressRouteLinkMacSecSciState"]] = None, + **kwargs + ): + super(ExpressRouteLinkMacSecConfig, self).__init__(**kwargs) + self.ckn_secret_identifier = ckn_secret_identifier + self.cak_secret_identifier = cak_secret_identifier + self.cipher = cipher + self.sci_state = sci_state + + +class ExpressRoutePort(Resource): + """ExpressRoutePort resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param identity: The identity of ExpressRoutePort, if configured. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :param peering_location: The name of the peering location that the ExpressRoutePort is mapped + to physically. + :type peering_location: str + :param bandwidth_in_gbps: Bandwidth of procured ports in Gbps. + :type bandwidth_in_gbps: int + :ivar provisioned_bandwidth_in_gbps: Aggregate Gbps of associated circuit bandwidths. + :vartype provisioned_bandwidth_in_gbps: float + :ivar mtu: Maximum transmission unit of the physical port pair(s). + :vartype mtu: str + :param encapsulation: Encapsulation method on physical ports. Possible values include: "Dot1Q", + "QinQ". + :type encapsulation: str or + ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsEncapsulation + :ivar ether_type: Ether type of the physical port. + :vartype ether_type: str + :ivar allocation_date: Date of the physical port allocation to be used in Letter of + Authorization. + :vartype allocation_date: str + :param links: The set of physical links of the ExpressRoutePort resource. + :type links: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the express route port resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar resource_guid: The resource GUID property of the express route port resource. + :vartype resource_guid: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioned_bandwidth_in_gbps': {'readonly': True}, + 'mtu': {'readonly': True}, + 'ether_type': {'readonly': True}, + 'allocation_date': {'readonly': True}, + 'circuits': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'bandwidth_in_gbps': {'key': 'properties.bandwidthInGbps', 'type': 'int'}, + 'provisioned_bandwidth_in_gbps': {'key': 'properties.provisionedBandwidthInGbps', 'type': 'float'}, + 'mtu': {'key': 'properties.mtu', 'type': 'str'}, + 'encapsulation': {'key': 'properties.encapsulation', 'type': 'str'}, + 'ether_type': {'key': 'properties.etherType', 'type': 'str'}, + 'allocation_date': {'key': 'properties.allocationDate', 'type': 'str'}, + 'links': {'key': 'properties.links', 'type': '[ExpressRouteLink]'}, + 'circuits': {'key': 'properties.circuits', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + peering_location: Optional[str] = None, + bandwidth_in_gbps: Optional[int] = None, + encapsulation: Optional[Union[str, "ExpressRoutePortsEncapsulation"]] = None, + links: Optional[List["ExpressRouteLink"]] = None, + **kwargs + ): + super(ExpressRoutePort, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.identity = identity + self.peering_location = peering_location + self.bandwidth_in_gbps = bandwidth_in_gbps + self.provisioned_bandwidth_in_gbps = None + self.mtu = None + self.encapsulation = encapsulation + self.ether_type = None + self.allocation_date = None + self.links = links + self.circuits = None + self.provisioning_state = None + self.resource_guid = None + + +class ExpressRoutePortListResult(msrest.serialization.Model): + """Response for ListExpressRoutePorts API service call. + + :param value: A list of ExpressRoutePort resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRoutePort]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRoutePort"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRoutePortListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRoutePortsLocation(Resource): + """Definition of the ExpressRoutePorts peering location resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar address: Address of peering location. + :vartype address: str + :ivar contact: Contact details of peering locations. + :vartype contact: str + :param available_bandwidths: The inventory of available ExpressRoutePort bandwidths. + :type available_bandwidths: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocationBandwidths] + :ivar provisioning_state: The provisioning state of the express route port location resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'address': {'readonly': True}, + 'contact': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address': {'key': 'properties.address', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'str'}, + 'available_bandwidths': {'key': 'properties.availableBandwidths', 'type': '[ExpressRoutePortsLocationBandwidths]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + available_bandwidths: Optional[List["ExpressRoutePortsLocationBandwidths"]] = None, + **kwargs + ): + super(ExpressRoutePortsLocation, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address = None + self.contact = None + self.available_bandwidths = available_bandwidths + self.provisioning_state = None + + +class ExpressRoutePortsLocationBandwidths(msrest.serialization.Model): + """Real-time inventory of available ExpressRoute port bandwidths. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar offer_name: Bandwidth descriptive name. + :vartype offer_name: str + :ivar value_in_gbps: Bandwidth value in Gbps. + :vartype value_in_gbps: int + """ + + _validation = { + 'offer_name': {'readonly': True}, + 'value_in_gbps': {'readonly': True}, + } + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_gbps': {'key': 'valueInGbps', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressRoutePortsLocationBandwidths, self).__init__(**kwargs) + self.offer_name = None + self.value_in_gbps = None + + +class ExpressRoutePortsLocationListResult(msrest.serialization.Model): + """Response for ListExpressRoutePortsLocations API service call. + + :param value: The list of all ExpressRoutePort peering locations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocation] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRoutePortsLocation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRoutePortsLocation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRoutePortsLocationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param peering_locations: A list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: A list of bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :ivar provisioning_state: The provisioning state of the express route service provider + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + peering_locations: Optional[List[str]] = None, + bandwidths_offered: Optional[List["ExpressRouteServiceProviderBandwidthsOffered"]] = None, + **kwargs + ): + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = None + + +class ExpressRouteServiceProviderBandwidthsOffered(msrest.serialization.Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__( + self, + *, + offer_name: Optional[str] = None, + value_in_mbps: Optional[int] = None, + **kwargs + ): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps + + +class ExpressRouteServiceProviderListResult(msrest.serialization.Model): + """Response for the ListExpressRouteServiceProvider API service call. + + :param value: A list of ExpressRouteResourceProvider resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteServiceProvider] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteServiceProvider]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExpressRouteServiceProvider"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ExpressRouteServiceProviderListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExtendedLocation(msrest.serialization.Model): + """ExtendedLocation complex type. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the extended location. + :type name: str + :param type: Required. The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.ExtendedLocationTypes + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "ExtendedLocationTypes"], + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class FirewallPolicy(Resource): + """FirewallPolicy Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param identity: The identity of the firewall policy. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the firewall policy resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param base_policy: The parent firewall policy from which rules are inherited. + :type base_policy: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar firewalls: List of references to Azure Firewalls that this Firewall Policy is associated + with. + :vartype firewalls: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param threat_intel_mode: The operation mode for Threat Intelligence. Possible values include: + "Alert", "Deny", "Off". + :type threat_intel_mode: str or + ~azure.mgmt.network.v2020_07_01.models.AzureFirewallThreatIntelMode + :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :type threat_intel_whitelist: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyThreatIntelWhitelist + :param dns_settings: DNS Proxy Settings definition. + :type dns_settings: ~azure.mgmt.network.v2020_07_01.models.DnsSettings + :param intrusion_detection: The configuration for Intrusion detection. + :type intrusion_detection: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetection + :param transport_security: TLS Configuration definition. + :type transport_security: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyTransportSecurity + :param sku: The Firewall Policy SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicySku + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'rule_collection_groups': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'readonly': True}, + 'child_policies': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'rule_collection_groups': {'key': 'properties.ruleCollectionGroups', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'base_policy': {'key': 'properties.basePolicy', 'type': 'SubResource'}, + 'firewalls': {'key': 'properties.firewalls', 'type': '[SubResource]'}, + 'child_policies': {'key': 'properties.childPolicies', 'type': '[SubResource]'}, + 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, + 'threat_intel_whitelist': {'key': 'properties.threatIntelWhitelist', 'type': 'FirewallPolicyThreatIntelWhitelist'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'DnsSettings'}, + 'intrusion_detection': {'key': 'properties.intrusionDetection', 'type': 'FirewallPolicyIntrusionDetection'}, + 'transport_security': {'key': 'properties.transportSecurity', 'type': 'FirewallPolicyTransportSecurity'}, + 'sku': {'key': 'properties.sku', 'type': 'FirewallPolicySku'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + base_policy: Optional["SubResource"] = None, + threat_intel_mode: Optional[Union[str, "AzureFirewallThreatIntelMode"]] = None, + threat_intel_whitelist: Optional["FirewallPolicyThreatIntelWhitelist"] = None, + dns_settings: Optional["DnsSettings"] = None, + intrusion_detection: Optional["FirewallPolicyIntrusionDetection"] = None, + transport_security: Optional["FirewallPolicyTransportSecurity"] = None, + sku: Optional["FirewallPolicySku"] = None, + **kwargs + ): + super(FirewallPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.identity = identity + self.rule_collection_groups = None + self.provisioning_state = None + self.base_policy = base_policy + self.firewalls = None + self.child_policies = None + self.threat_intel_mode = threat_intel_mode + self.threat_intel_whitelist = threat_intel_whitelist + self.dns_settings = dns_settings + self.intrusion_detection = intrusion_detection + self.transport_security = transport_security + self.sku = sku + + +class FirewallPolicyCertificateAuthority(msrest.serialization.Model): + """Trusted Root certificates properties for tls. + + :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or + 'Certificate' object stored in KeyVault. + :type key_vault_secret_id: str + :param name: Name of the CA certificate. + :type name: str + """ + + _attribute_map = { + 'key_vault_secret_id': {'key': 'keyVaultSecretId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault_secret_id: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(FirewallPolicyCertificateAuthority, self).__init__(**kwargs) + self.key_vault_secret_id = key_vault_secret_id + self.name = name + + +class FirewallPolicyRuleCollection(msrest.serialization.Model): + """Properties of the rule collection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FirewallPolicyFilterRuleCollection, FirewallPolicyNatRuleCollection. + + All required parameters must be populated in order to send to Azure. + + :param rule_collection_type: Required. The type of the rule collection.Constant filled by + server. Possible values include: "FirewallPolicyNatRuleCollection", + "FirewallPolicyFilterRuleCollection". + :type rule_collection_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionType + :param name: The name of the rule collection. + :type name: str + :param priority: Priority of the Firewall Policy Rule Collection resource. + :type priority: int + """ + + _validation = { + 'rule_collection_type': {'required': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + } + + _attribute_map = { + 'rule_collection_type': {'key': 'ruleCollectionType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + } + + _subtype_map = { + 'rule_collection_type': {'FirewallPolicyFilterRuleCollection': 'FirewallPolicyFilterRuleCollection', 'FirewallPolicyNatRuleCollection': 'FirewallPolicyNatRuleCollection'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + priority: Optional[int] = None, + **kwargs + ): + super(FirewallPolicyRuleCollection, self).__init__(**kwargs) + self.rule_collection_type = None # type: Optional[str] + self.name = name + self.priority = priority + + +class FirewallPolicyFilterRuleCollection(FirewallPolicyRuleCollection): + """Firewall Policy Filter Rule Collection. + + All required parameters must be populated in order to send to Azure. + + :param rule_collection_type: Required. The type of the rule collection.Constant filled by + server. Possible values include: "FirewallPolicyNatRuleCollection", + "FirewallPolicyFilterRuleCollection". + :type rule_collection_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionType + :param name: The name of the rule collection. + :type name: str + :param priority: Priority of the Firewall Policy Rule Collection resource. + :type priority: int + :param action: The action type of a Filter rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyFilterRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRule] + """ + + _validation = { + 'rule_collection_type': {'required': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + } + + _attribute_map = { + 'rule_collection_type': {'key': 'ruleCollectionType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'FirewallPolicyFilterRuleCollectionAction'}, + 'rules': {'key': 'rules', 'type': '[FirewallPolicyRule]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["FirewallPolicyFilterRuleCollectionAction"] = None, + rules: Optional[List["FirewallPolicyRule"]] = None, + **kwargs + ): + super(FirewallPolicyFilterRuleCollection, self).__init__(name=name, priority=priority, **kwargs) + self.rule_collection_type = 'FirewallPolicyFilterRuleCollection' # type: str + self.action = action + self.rules = rules + + +class FirewallPolicyFilterRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyFilterRuleCollectionAction. + + :param type: The type of action. Possible values include: "Allow", "Deny". + :type type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyFilterRuleCollectionActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "FirewallPolicyFilterRuleCollectionActionType"]] = None, + **kwargs + ): + super(FirewallPolicyFilterRuleCollectionAction, self).__init__(**kwargs) + self.type = type + + +class FirewallPolicyIntrusionDetection(msrest.serialization.Model): + """Configuration for intrusion detection mode and rules. + + :param mode: Intrusion detection general state. Possible values include: "Off", "Alert", + "Deny". + :type mode: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionStateType + :param configuration: Intrusion detection configuration properties. + :type configuration: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionConfiguration + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'FirewallPolicyIntrusionDetectionConfiguration'}, + } + + def __init__( + self, + *, + mode: Optional[Union[str, "FirewallPolicyIntrusionDetectionStateType"]] = None, + configuration: Optional["FirewallPolicyIntrusionDetectionConfiguration"] = None, + **kwargs + ): + super(FirewallPolicyIntrusionDetection, self).__init__(**kwargs) + self.mode = mode + self.configuration = configuration + + +class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications(msrest.serialization.Model): + """Intrusion detection bypass traffic specification. + + :param name: Name of the bypass traffic rule. + :type name: str + :param description: Description of the bypass traffic rule. + :type description: str + :param protocol: The rule bypass protocol. Possible values include: "TCP", "UDP", "ICMP", + "ANY". + :type protocol: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionProtocol + :param source_addresses: List of source IP addresses or ranges for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or ranges for this rule. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports or ranges. + :type destination_ports: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param destination_ip_groups: List of destination IpGroups for this rule. + :type destination_ip_groups: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'destination_ip_groups': {'key': 'destinationIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + protocol: Optional[Union[str, "FirewallPolicyIntrusionDetectionProtocol"]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + destination_ip_groups: Optional[List[str]] = None, + **kwargs + ): + super(FirewallPolicyIntrusionDetectionBypassTrafficSpecifications, self).__init__(**kwargs) + self.name = name + self.description = description + self.protocol = protocol + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.source_ip_groups = source_ip_groups + self.destination_ip_groups = destination_ip_groups + + +class FirewallPolicyIntrusionDetectionConfiguration(msrest.serialization.Model): + """The operation for configuring intrusion detection. + + :param signature_overrides: List of specific signatures states. + :type signature_overrides: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionSignatureSpecification] + :param bypass_traffic_settings: List of rules for traffic to bypass. + :type bypass_traffic_settings: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications] + """ + + _attribute_map = { + 'signature_overrides': {'key': 'signatureOverrides', 'type': '[FirewallPolicyIntrusionDetectionSignatureSpecification]'}, + 'bypass_traffic_settings': {'key': 'bypassTrafficSettings', 'type': '[FirewallPolicyIntrusionDetectionBypassTrafficSpecifications]'}, + } + + def __init__( + self, + *, + signature_overrides: Optional[List["FirewallPolicyIntrusionDetectionSignatureSpecification"]] = None, + bypass_traffic_settings: Optional[List["FirewallPolicyIntrusionDetectionBypassTrafficSpecifications"]] = None, + **kwargs + ): + super(FirewallPolicyIntrusionDetectionConfiguration, self).__init__(**kwargs) + self.signature_overrides = signature_overrides + self.bypass_traffic_settings = bypass_traffic_settings + + +class FirewallPolicyIntrusionDetectionSignatureSpecification(msrest.serialization.Model): + """Intrusion detection signatures specification states. + + :param id: Signature id. + :type id: str + :param mode: The signature state. Possible values include: "Off", "Alert", "Deny". + :type mode: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyIntrusionDetectionStateType + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + mode: Optional[Union[str, "FirewallPolicyIntrusionDetectionStateType"]] = None, + **kwargs + ): + super(FirewallPolicyIntrusionDetectionSignatureSpecification, self).__init__(**kwargs) + self.id = id + self.mode = mode + + +class FirewallPolicyListResult(msrest.serialization.Model): + """Response for ListFirewallPolicies API service call. + + :param value: List of Firewall Policies in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicy] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FirewallPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["FirewallPolicy"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(FirewallPolicyListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class FirewallPolicyNatRuleCollection(FirewallPolicyRuleCollection): + """Firewall Policy NAT Rule Collection. + + All required parameters must be populated in order to send to Azure. + + :param rule_collection_type: Required. The type of the rule collection.Constant filled by + server. Possible values include: "FirewallPolicyNatRuleCollection", + "FirewallPolicyFilterRuleCollection". + :type rule_collection_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionType + :param name: The name of the rule collection. + :type name: str + :param priority: Priority of the Firewall Policy Rule Collection resource. + :type priority: int + :param action: The action type of a Nat rule collection. + :type action: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyNatRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRule] + """ + + _validation = { + 'rule_collection_type': {'required': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + } + + _attribute_map = { + 'rule_collection_type': {'key': 'ruleCollectionType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'FirewallPolicyNatRuleCollectionAction'}, + 'rules': {'key': 'rules', 'type': '[FirewallPolicyRule]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + priority: Optional[int] = None, + action: Optional["FirewallPolicyNatRuleCollectionAction"] = None, + rules: Optional[List["FirewallPolicyRule"]] = None, + **kwargs + ): + super(FirewallPolicyNatRuleCollection, self).__init__(name=name, priority=priority, **kwargs) + self.rule_collection_type = 'FirewallPolicyNatRuleCollection' # type: str + self.action = action + self.rules = rules + + +class FirewallPolicyNatRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + :param type: The type of action. Possible values include: "DNAT". + :type type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyNatRuleCollectionActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "FirewallPolicyNatRuleCollectionActionType"]] = None, + **kwargs + ): + super(FirewallPolicyNatRuleCollectionAction, self).__init__(**kwargs) + self.type = type + + +class FirewallPolicyRuleApplicationProtocol(msrest.serialization.Model): + """Properties of the application rule protocol. + + :param protocol_type: Protocol type. Possible values include: "Http", "Https". + :type protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleApplicationProtocolType + :param port: Port number for the protocol, cannot be greater than 64000. + :type port: int + """ + + _validation = { + 'port': {'maximum': 64000, 'minimum': 0}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__( + self, + *, + protocol_type: Optional[Union[str, "FirewallPolicyRuleApplicationProtocolType"]] = None, + port: Optional[int] = None, + **kwargs + ): + super(FirewallPolicyRuleApplicationProtocol, self).__init__(**kwargs) + self.protocol_type = protocol_type + self.port = port + + +class FirewallPolicyRuleCollectionGroup(SubResource): + """Rule Collection Group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Rule Group type. + :vartype type: str + :param priority: Priority of the Firewall Policy Rule Collection Group resource. + :type priority: int + :param rule_collections: Group of Firewall Policy rule collections. + :type rule_collections: + list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollection] + :ivar provisioning_state: The provisioning state of the firewall policy rule collection group + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'priority': {'maximum': 65000, 'minimum': 100}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'rule_collections': {'key': 'properties.ruleCollections', 'type': '[FirewallPolicyRuleCollection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + priority: Optional[int] = None, + rule_collections: Optional[List["FirewallPolicyRuleCollection"]] = None, + **kwargs + ): + super(FirewallPolicyRuleCollectionGroup, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.priority = priority + self.rule_collections = rule_collections + self.provisioning_state = None + + +class FirewallPolicyRuleCollectionGroupListResult(msrest.serialization.Model): + """Response for ListFirewallPolicyRuleCollectionGroups API service call. + + :param value: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FirewallPolicyRuleCollectionGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["FirewallPolicyRuleCollectionGroup"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(FirewallPolicyRuleCollectionGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class FirewallPolicySku(msrest.serialization.Model): + """SKU of Firewall policy. + + :param tier: Tier of Firewall Policy. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicySkuTier + """ + + _attribute_map = { + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + tier: Optional[Union[str, "FirewallPolicySkuTier"]] = None, + **kwargs + ): + super(FirewallPolicySku, self).__init__(**kwargs) + self.tier = tier + + +class FirewallPolicyThreatIntelWhitelist(msrest.serialization.Model): + """ThreatIntel Whitelist for Firewall Policy. + + :param ip_addresses: List of IP addresses for the ThreatIntel Whitelist. + :type ip_addresses: list[str] + :param fqdns: List of FQDNs for the ThreatIntel Whitelist. + :type fqdns: list[str] + """ + + _attribute_map = { + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + } + + def __init__( + self, + *, + ip_addresses: Optional[List[str]] = None, + fqdns: Optional[List[str]] = None, + **kwargs + ): + super(FirewallPolicyThreatIntelWhitelist, self).__init__(**kwargs) + self.ip_addresses = ip_addresses + self.fqdns = fqdns + + +class FirewallPolicyTransportSecurity(msrest.serialization.Model): + """Configuration needed to perform TLS termination & initiation. + + :param certificate_authority: The CA used for intermediate CA generation. + :type certificate_authority: + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyCertificateAuthority + """ + + _attribute_map = { + 'certificate_authority': {'key': 'certificateAuthority', 'type': 'FirewallPolicyCertificateAuthority'}, + } + + def __init__( + self, + *, + certificate_authority: Optional["FirewallPolicyCertificateAuthority"] = None, + **kwargs + ): + super(FirewallPolicyTransportSecurity, self).__init__(**kwargs) + self.certificate_authority = certificate_authority + + +class FlowLog(Resource): + """A flow log resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param target_resource_id: ID of network security group to which flow log will be applied. + :type target_resource_id: str + :ivar target_resource_guid: Guid of network security group to which flow log will be applied. + :vartype target_resource_guid: str + :param storage_id: ID of the storage account which is used to store the flow log. + :type storage_id: str + :param enabled: Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: Parameters that define the retention policy for flow log. + :type retention_policy: ~azure.mgmt.network.v2020_07_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_07_01.models.FlowLogFormatParameters + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_07_01.models.TrafficAnalyticsProperties + :ivar provisioning_state: The provisioning state of the flow log. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'target_resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'}, + 'target_resource_guid': {'key': 'properties.targetResourceGuid', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + 'format': {'key': 'properties.format', 'type': 'FlowLogFormatParameters'}, + 'flow_analytics_configuration': {'key': 'properties.flowAnalyticsConfiguration', 'type': 'TrafficAnalyticsProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + target_resource_id: Optional[str] = None, + storage_id: Optional[str] = None, + enabled: Optional[bool] = None, + retention_policy: Optional["RetentionPolicyParameters"] = None, + format: Optional["FlowLogFormatParameters"] = None, + flow_analytics_configuration: Optional["TrafficAnalyticsProperties"] = None, + **kwargs + ): + super(FlowLog, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.target_resource_id = target_resource_id + self.target_resource_guid = None + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy + self.format = format + self.flow_analytics_configuration = flow_analytics_configuration + self.provisioning_state = None + + +class FlowLogFormatParameters(msrest.serialization.Model): + """Parameters that define the flow log format. + + :param type: The file type of flow log. Possible values include: "JSON". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.FlowLogFormatType + :param version: The version (revision) of the flow log. + :type version: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "FlowLogFormatType"]] = None, + version: Optional[int] = 0, + **kwargs + ): + super(FlowLogFormatParameters, self).__init__(**kwargs) + self.type = type + self.version = version + + +class FlowLogInformation(msrest.serialization.Model): + """Information on the configuration of flow log and traffic analytics (optional) . + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure for flow log and + traffic analytics (optional) . + :type target_resource_id: str + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_07_01.models.TrafficAnalyticsProperties + :param storage_id: Required. ID of the storage account which is used to store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: Parameters that define the retention policy for flow log. + :type retention_policy: ~azure.mgmt.network.v2020_07_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_07_01.models.FlowLogFormatParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'flow_analytics_configuration': {'key': 'flowAnalyticsConfiguration', 'type': 'TrafficAnalyticsProperties'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + 'format': {'key': 'properties.format', 'type': 'FlowLogFormatParameters'}, + } + + def __init__( + self, + *, + target_resource_id: str, + storage_id: str, + enabled: bool, + flow_analytics_configuration: Optional["TrafficAnalyticsProperties"] = None, + retention_policy: Optional["RetentionPolicyParameters"] = None, + format: Optional["FlowLogFormatParameters"] = None, + **kwargs + ): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.flow_analytics_configuration = flow_analytics_configuration + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy + self.format = format + + +class FlowLogListResult(msrest.serialization.Model): + """List of flow logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Information about flow log resource. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FlowLog] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FlowLog]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["FlowLog"]] = None, + **kwargs + ): + super(FlowLogListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class FlowLogStatusParameters(msrest.serialization.Model): + """Parameters that define a resource to query flow log and traffic analytics (optional) status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the flow log and traffic + analytics (optional) status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + target_resource_id: str, + **kwargs + ): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of frontend IP + configurations used by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :ivar inbound_nat_rules: An array of references to inbound rules that use this frontend IP. + :vartype inbound_nat_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar inbound_nat_pools: An array of references to inbound pools that use this frontend IP. + :vartype inbound_nat_pools: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar outbound_rules: An array of references to outbound rules that use this frontend IP. + :vartype outbound_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar load_balancing_rules: An array of references to load balancing rules that use this + frontend IP. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. Possible values include: + "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param private_ip_address_version: Whether the specific ipconfiguration is IPv4 or IPv6. + Default is taken as IPv4. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param public_ip_address: The reference to the Public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :param public_ip_prefix: The reference to the Public IP Prefix resource. + :type public_ip_prefix: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the frontend IP configuration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_rules': {'key': 'properties.outboundRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + zones: Optional[List[str]] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + private_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + subnet: Optional["Subnet"] = None, + public_ip_address: Optional["PublicIPAddress"] = None, + public_ip_prefix: Optional["SubResource"] = None, + **kwargs + ): + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.zones = zones + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.public_ip_address = public_ip_address + self.public_ip_prefix = public_ip_prefix + self.provisioning_state = None + + +class GatewayRoute(msrest.serialization.Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The gateway's local address. + :vartype local_address: str + :ivar network: The route's network prefix. + :vartype network: str + :ivar next_hop: The route's next hop. + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from. + :vartype source_peer: str + :ivar origin: The source this route was learned from. + :vartype origin: str + :ivar as_path: The route's AS path sequence. + :vartype as_path: str + :ivar weight: The route's weight. + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None + + +class GatewayRouteListResult(msrest.serialization.Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes. + :type value: list[~azure.mgmt.network.v2020_07_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__( + self, + *, + value: Optional[List["GatewayRoute"]] = None, + **kwargs + ): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value + + +class GenerateExpressRoutePortsLOARequest(msrest.serialization.Model): + """The customer name to be printed on a letter of authorization. + + All required parameters must be populated in order to send to Azure. + + :param customer_name: Required. The customer name. + :type customer_name: str + """ + + _validation = { + 'customer_name': {'required': True}, + } + + _attribute_map = { + 'customer_name': {'key': 'customerName', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_name: str, + **kwargs + ): + super(GenerateExpressRoutePortsLOARequest, self).__init__(**kwargs) + self.customer_name = customer_name + + +class GenerateExpressRoutePortsLOAResult(msrest.serialization.Model): + """Response for GenerateExpressRoutePortsLOA API service call. + + :param encoded_content: The content as a base64 encoded string. + :type encoded_content: str + """ + + _attribute_map = { + 'encoded_content': {'key': 'encodedContent', 'type': 'str'}, + } + + def __init__( + self, + *, + encoded_content: Optional[str] = None, + **kwargs + ): + super(GenerateExpressRoutePortsLOAResult, self).__init__(**kwargs) + self.encoded_content = encoded_content + + +class GetVpnSitesConfigurationRequest(msrest.serialization.Model): + """List of Vpn-Sites. + + All required parameters must be populated in order to send to Azure. + + :param vpn_sites: List of resource-ids of the vpn-sites for which config is to be downloaded. + :type vpn_sites: list[str] + :param output_blob_sas_url: Required. The sas-url to download the configurations for vpn-sites. + :type output_blob_sas_url: str + """ + + _validation = { + 'output_blob_sas_url': {'required': True}, + } + + _attribute_map = { + 'vpn_sites': {'key': 'vpnSites', 'type': '[str]'}, + 'output_blob_sas_url': {'key': 'outputBlobSasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + output_blob_sas_url: str, + vpn_sites: Optional[List[str]] = None, + **kwargs + ): + super(GetVpnSitesConfigurationRequest, self).__init__(**kwargs) + self.vpn_sites = vpn_sites + self.output_blob_sas_url = output_blob_sas_url + + +class HopLink(msrest.serialization.Model): + """Hop link. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar next_hop_id: The ID of the next hop. + :vartype next_hop_id: str + :ivar link_type: Link type. + :vartype link_type: str + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_07_01.models.ConnectivityIssue] + :ivar context: Provides additional context on links. + :vartype context: dict[str, str] + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar round_trip_time_min: Minimum roundtrip time in milliseconds. + :vartype round_trip_time_min: long + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: long + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: long + """ + + _validation = { + 'next_hop_id': {'readonly': True}, + 'link_type': {'readonly': True}, + 'issues': {'readonly': True}, + 'context': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'round_trip_time_min': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + 'round_trip_time_avg': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + 'round_trip_time_max': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, + } + + _attribute_map = { + 'next_hop_id': {'key': 'nextHopId', 'type': 'str'}, + 'link_type': {'key': 'linkType', 'type': 'str'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + 'context': {'key': 'context', 'type': '{str}'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'round_trip_time_min': {'key': 'properties.roundTripTimeMin', 'type': 'long'}, + 'round_trip_time_avg': {'key': 'properties.roundTripTimeAvg', 'type': 'long'}, + 'round_trip_time_max': {'key': 'properties.roundTripTimeMax', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(HopLink, self).__init__(**kwargs) + self.next_hop_id = None + self.link_type = None + self.issues = None + self.context = None + self.resource_id = None + self.round_trip_time_min = None + self.round_trip_time_avg = None + self.round_trip_time_max = None + + +class HTTPConfiguration(msrest.serialization.Model): + """HTTP configuration of the connectivity check. + + :param method: HTTP method. Possible values include: "Get". + :type method: str or ~azure.mgmt.network.v2020_07_01.models.HTTPMethod + :param headers: List of HTTP headers. + :type headers: list[~azure.mgmt.network.v2020_07_01.models.HTTPHeader] + :param valid_status_codes: Valid status codes. + :type valid_status_codes: list[int] + """ + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '[HTTPHeader]'}, + 'valid_status_codes': {'key': 'validStatusCodes', 'type': '[int]'}, + } + + def __init__( + self, + *, + method: Optional[Union[str, "HTTPMethod"]] = None, + headers: Optional[List["HTTPHeader"]] = None, + valid_status_codes: Optional[List[int]] = None, + **kwargs + ): + super(HTTPConfiguration, self).__init__(**kwargs) + self.method = method + self.headers = headers + self.valid_status_codes = valid_status_codes + + +class HTTPHeader(msrest.serialization.Model): + """The HTTP header. + + :param name: The name in HTTP header. + :type name: str + :param value: The value in HTTP header. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(HTTPHeader, self).__init__(**kwargs) + self.name = name + self.value = value + + +class HubIPAddresses(msrest.serialization.Model): + """IP addresses associated with azure firewall. + + :param public_i_ps: Public IP addresses associated with azure firewall. + :type public_i_ps: ~azure.mgmt.network.v2020_07_01.models.HubPublicIPAddresses + :param private_ip_address: Private IP Address associated with azure firewall. + :type private_ip_address: str + """ + + _attribute_map = { + 'public_i_ps': {'key': 'publicIPs', 'type': 'HubPublicIPAddresses'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + public_i_ps: Optional["HubPublicIPAddresses"] = None, + private_ip_address: Optional[str] = None, + **kwargs + ): + super(HubIPAddresses, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + self.private_ip_address = private_ip_address + + +class HubIpConfiguration(SubResource): + """IpConfigurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the Ip Configuration. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Ipconfiguration type. + :vartype type: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :ivar provisioning_state: The provisioning state of the IP configuration resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + subnet: Optional["Subnet"] = None, + public_ip_address: Optional["PublicIPAddress"] = None, + **kwargs + ): + super(HubIpConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + + +class HubPublicIPAddresses(msrest.serialization.Model): + """Public IP addresses associated with azure firewall. + + :param addresses: The list of Public IP addresses associated with azure firewall or IP + addresses to be retained. + :type addresses: list[~azure.mgmt.network.v2020_07_01.models.AzureFirewallPublicIPAddress] + :param count: The number of Public IP addresses associated with azure firewall. + :type count: int + """ + + _attribute_map = { + 'addresses': {'key': 'addresses', 'type': '[AzureFirewallPublicIPAddress]'}, + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + addresses: Optional[List["AzureFirewallPublicIPAddress"]] = None, + count: Optional[int] = None, + **kwargs + ): + super(HubPublicIPAddresses, self).__init__(**kwargs) + self.addresses = addresses + self.count = count + + +class HubRoute(msrest.serialization.Model): + """RouteTable route. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Route that is unique within a RouteTable. This name can + be used to access this route. + :type name: str + :param destination_type: Required. The type of destinations (eg: CIDR, ResourceId, Service). + :type destination_type: str + :param destinations: Required. List of all destinations. + :type destinations: list[str] + :param next_hop_type: Required. The type of next hop (eg: ResourceId). + :type next_hop_type: str + :param next_hop: Required. NextHop resource ID. + :type next_hop: str + """ + + _validation = { + 'name': {'required': True}, + 'destination_type': {'required': True}, + 'destinations': {'required': True}, + 'next_hop_type': {'required': True}, + 'next_hop': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'destination_type': {'key': 'destinationType', 'type': 'str'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + destination_type: str, + destinations: List[str], + next_hop_type: str, + next_hop: str, + **kwargs + ): + super(HubRoute, self).__init__(**kwargs) + self.name = name + self.destination_type = destination_type + self.destinations = destinations + self.next_hop_type = next_hop_type + self.next_hop = next_hop + + +class HubRouteTable(SubResource): + """RouteTable resource in a virtual hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param routes: List of all routes. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.HubRoute] + :param labels: List of labels associated with this route table. + :type labels: list[str] + :ivar associated_connections: List of all connections associated with this route table. + :vartype associated_connections: list[str] + :ivar propagating_connections: List of all connections that advertise to this route table. + :vartype propagating_connections: list[str] + :ivar provisioning_state: The provisioning state of the RouteTable resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'associated_connections': {'readonly': True}, + 'propagating_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[HubRoute]'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'associated_connections': {'key': 'properties.associatedConnections', 'type': '[str]'}, + 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + routes: Optional[List["HubRoute"]] = None, + labels: Optional[List[str]] = None, + **kwargs + ): + super(HubRouteTable, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.routes = routes + self.labels = labels + self.associated_connections = None + self.propagating_connections = None + self.provisioning_state = None + + +class HubVirtualNetworkConnection(SubResource): + """HubVirtualNetworkConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param remote_virtual_network: Reference to the remote virtual network. + :type remote_virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param allow_hub_to_remote_vnet_transit: Deprecated: VirtualHub to RemoteVnet transit to + enabled or not. + :type allow_hub_to_remote_vnet_transit: bool + :param allow_remote_vnet_to_use_hub_vnet_gateways: Deprecated: Allow RemoteVnet to use Virtual + Hub's gateways. + :type allow_remote_vnet_to_use_hub_vnet_gateways: bool + :param enable_internet_security: Enable internet security. + :type enable_internet_security: bool + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + :ivar provisioning_state: The provisioning state of the hub virtual network connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'allow_hub_to_remote_vnet_transit': {'key': 'properties.allowHubToRemoteVnetTransit', 'type': 'bool'}, + 'allow_remote_vnet_to_use_hub_vnet_gateways': {'key': 'properties.allowRemoteVnetToUseHubVnetGateways', 'type': 'bool'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + remote_virtual_network: Optional["SubResource"] = None, + allow_hub_to_remote_vnet_transit: Optional[bool] = None, + allow_remote_vnet_to_use_hub_vnet_gateways: Optional[bool] = None, + enable_internet_security: Optional[bool] = None, + routing_configuration: Optional["RoutingConfiguration"] = None, + **kwargs + ): + super(HubVirtualNetworkConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.remote_virtual_network = remote_virtual_network + self.allow_hub_to_remote_vnet_transit = allow_hub_to_remote_vnet_transit + self.allow_remote_vnet_to_use_hub_vnet_gateways = allow_remote_vnet_to_use_hub_vnet_gateways + self.enable_internet_security = enable_internet_security + self.routing_configuration = routing_configuration + self.provisioning_state = None + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of inbound NAT pools used + by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protocol: The reference to the transport protocol used by the inbound NAT pool. Possible + values include: "Udp", "Tcp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.TransportProtocol + :param frontend_port_range_start: The first port number in the range of external ports that + will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values + range between 1 and 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: The last port number in the range of external ports that will + be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range + between 1 and 65535. + :type frontend_port_range_end: int + :param backend_port: The port used for internal connections on the endpoint. Acceptable values + are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :type enable_floating_ip: bool + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :ivar provisioning_state: The provisioning state of the inbound NAT pool resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + frontend_ip_configuration: Optional["SubResource"] = None, + protocol: Optional[Union[str, "TransportProtocol"]] = None, + frontend_port_range_start: Optional[int] = None, + frontend_port_range_end: Optional[int] = None, + backend_port: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_floating_ip: Optional[bool] = None, + enable_tcp_reset: Optional[bool] = None, + **kwargs + ): + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset + self.provisioning_state = None + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of inbound NAT rules used + by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address defined on a network + interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations + is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :param protocol: The reference to the transport protocol used by the load balancing rule. + Possible values include: "Udp", "Tcp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values range from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable values range from 1 to + 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :type enable_floating_ip: bool + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :ivar provisioning_state: The provisioning state of the inbound NAT rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'backend_ip_configuration': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + frontend_ip_configuration: Optional["SubResource"] = None, + protocol: Optional[Union[str, "TransportProtocol"]] = None, + frontend_port: Optional[int] = None, + backend_port: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_floating_ip: Optional[bool] = None, + enable_tcp_reset: Optional[bool] = None, + **kwargs + ): + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset + self.provisioning_state = None + + +class InboundNatRuleListResult(msrest.serialization.Model): + """Response for ListInboundNatRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of inbound nat rules in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundNatRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["InboundNatRule"]] = None, + **kwargs + ): + super(InboundNatRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class InboundSecurityRule(SubResource): + """NVA Inbound Security Rule resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of security rule collection. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: NVA inbound security rule type. + :vartype type: str + :param rules: List of allowed rules. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.InboundSecurityRules] + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[InboundSecurityRules]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + rules: Optional[List["InboundSecurityRules"]] = None, + **kwargs + ): + super(InboundSecurityRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.rules = rules + self.provisioning_state = None + + +class InboundSecurityRules(msrest.serialization.Model): + """Properties of the Inbound Security Rules resource. + + :param protocol: Protocol. This should be either TCP or UDP. Possible values include: "TCP", + "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.InboundSecurityRulesProtocol + :param source_address_prefix: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are + allowed. + :type source_address_prefix: str + :param destination_port_range: NVA port ranges to be opened up. One needs to provide specific + ports. + :type destination_port_range: int + """ + + _validation = { + 'destination_port_range': {'maximum': 65535, 'minimum': 0}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'int'}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "InboundSecurityRulesProtocol"]] = None, + source_address_prefix: Optional[str] = None, + destination_port_range: Optional[int] = None, + **kwargs + ): + super(InboundSecurityRules, self).__init__(**kwargs) + self.protocol = protocol + self.source_address_prefix = source_address_prefix + self.destination_port_range = destination_port_range + + +class IPAddressAvailabilityResult(msrest.serialization.Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP addresses if the asked for + address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + available: Optional[bool] = None, + available_ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses + + +class IpAllocation(Resource): + """IpAllocation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar subnet: The Subnet that using the prefix of this IpAllocation resource. + :vartype subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param type_properties_type: The type for the IpAllocation. Possible values include: + "Undefined", "Hypernet". + :type type_properties_type: str or ~azure.mgmt.network.v2020_07_01.models.IpAllocationType + :param prefix: The address prefix for the IpAllocation. + :type prefix: str + :param prefix_length: The address prefix length for the IpAllocation. + :type prefix_length: int + :param prefix_type: The address prefix Type for the IpAllocation. Possible values include: + "IPv4", "IPv6". + :type prefix_type: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param ipam_allocation_id: The IPAM allocation ID. + :type ipam_allocation_id: str + :param allocation_tags: IpAllocation tags. + :type allocation_tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnet': {'readonly': True}, + 'virtual_network': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, + 'prefix_type': {'key': 'properties.prefixType', 'type': 'str'}, + 'ipam_allocation_id': {'key': 'properties.ipamAllocationId', 'type': 'str'}, + 'allocation_tags': {'key': 'properties.allocationTags', 'type': '{str}'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + type_properties_type: Optional[Union[str, "IpAllocationType"]] = None, + prefix: Optional[str] = None, + prefix_length: Optional[int] = 0, + prefix_type: Optional[Union[str, "IPVersion"]] = None, + ipam_allocation_id: Optional[str] = None, + allocation_tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(IpAllocation, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.subnet = None + self.virtual_network = None + self.type_properties_type = type_properties_type + self.prefix = prefix + self.prefix_length = prefix_length + self.prefix_type = prefix_type + self.ipam_allocation_id = ipam_allocation_id + self.allocation_tags = allocation_tags + + +class IpAllocationListResult(msrest.serialization.Model): + """Response for the ListIpAllocations API service call. + + :param value: A list of IpAllocation resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.IpAllocation] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IpAllocation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IpAllocation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IpAllocationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IPConfiguration(SubResource): + """IP configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :ivar provisioning_state: The provisioning state of the IP configuration resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + subnet: Optional["Subnet"] = None, + public_ip_address: Optional["PublicIPAddress"] = None, + **kwargs + ): + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + + +class IPConfigurationBgpPeeringAddress(msrest.serialization.Model): + """Properties of IPConfigurationBgpPeeringAddress. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param ipconfiguration_id: The ID of IP configuration which belongs to gateway. + :type ipconfiguration_id: str + :ivar default_bgp_ip_addresses: The list of default BGP peering addresses which belong to IP + configuration. + :vartype default_bgp_ip_addresses: list[str] + :param custom_bgp_ip_addresses: The list of custom BGP peering addresses which belong to IP + configuration. + :type custom_bgp_ip_addresses: list[str] + :ivar tunnel_ip_addresses: The list of tunnel public IP addresses which belong to IP + configuration. + :vartype tunnel_ip_addresses: list[str] + """ + + _validation = { + 'default_bgp_ip_addresses': {'readonly': True}, + 'tunnel_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'ipconfiguration_id': {'key': 'ipconfigurationId', 'type': 'str'}, + 'default_bgp_ip_addresses': {'key': 'defaultBgpIpAddresses', 'type': '[str]'}, + 'custom_bgp_ip_addresses': {'key': 'customBgpIpAddresses', 'type': '[str]'}, + 'tunnel_ip_addresses': {'key': 'tunnelIpAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + ipconfiguration_id: Optional[str] = None, + custom_bgp_ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(IPConfigurationBgpPeeringAddress, self).__init__(**kwargs) + self.ipconfiguration_id = ipconfiguration_id + self.default_bgp_ip_addresses = None + self.custom_bgp_ip_addresses = custom_bgp_ip_addresses + self.tunnel_ip_addresses = None + + +class IPConfigurationProfile(SubResource): + """IP configuration profile child resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource. This name can be used to access the resource. + :type name: str + :ivar type: Sub Resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param subnet: The reference to the subnet resource to create a container network interface ip + configuration. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :ivar provisioning_state: The provisioning state of the IP configuration profile resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + subnet: Optional["Subnet"] = None, + **kwargs + ): + super(IPConfigurationProfile, self).__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.subnet = subnet + self.provisioning_state = None + + +class IpGroup(Resource): + """The IpGroups resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the IpGroups resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :type ip_addresses: list[str] + :ivar firewalls: List of references to Firewall resources that this IpGroups is associated + with. + :vartype firewalls: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar firewall_policies: List of references to Firewall Policies resources that this IpGroups + is associated with. + :vartype firewall_policies: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'readonly': True}, + 'firewall_policies': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'ip_addresses': {'key': 'properties.ipAddresses', 'type': '[str]'}, + 'firewalls': {'key': 'properties.firewalls', 'type': '[SubResource]'}, + 'firewall_policies': {'key': 'properties.firewallPolicies', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(IpGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + self.ip_addresses = ip_addresses + self.firewalls = None + self.firewall_policies = None + + +class IpGroupListResult(msrest.serialization.Model): + """Response for the ListIpGroups API service call. + + :param value: The list of IpGroups information resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.IpGroup] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IpGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IpGroup"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IpGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IpsecPolicy(msrest.serialization.Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) payload size in KB for a site to site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE phase 1). Possible + values include: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", + "GCMAES256". + :type ipsec_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase 1). Possible values + include: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", "GCMAES256". + :type ipsec_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase 2). Possible values + include: "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", "GCMAES128". + :type ike_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). Possible values + include: "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", "GCMAES128". + :type ike_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IkeIntegrity + :param dh_group: Required. The DH Group used in IKE Phase 1 for initial SA. Possible values + include: "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", + "DHGroup24". + :type dh_group: str or ~azure.mgmt.network.v2020_07_01.models.DhGroup + :param pfs_group: Required. The Pfs Group used in IKE Phase 2 for new child SA. Possible values + include: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", "PFSMM". + :type pfs_group: str or ~azure.mgmt.network.v2020_07_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + sa_life_time_seconds: int, + sa_data_size_kilobytes: int, + ipsec_encryption: Union[str, "IpsecEncryption"], + ipsec_integrity: Union[str, "IpsecIntegrity"], + ike_encryption: Union[str, "IkeEncryption"], + ike_integrity: Union[str, "IkeIntegrity"], + dh_group: Union[str, "DhGroup"], + pfs_group: Union[str, "PfsGroup"], + **kwargs + ): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group + + +class IpTag(msrest.serialization.Model): + """Contains the IpTag associated with the object. + + :param ip_tag_type: The IP tag type. Example: FirstPartyUsage. + :type ip_tag_type: str + :param tag: The value of the IP tag associated with the public IP. Example: SQL. + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_tag_type: Optional[str] = None, + tag: Optional[str] = None, + **kwargs + ): + super(IpTag, self).__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class Ipv6CircuitConnectionConfig(msrest.serialization.Model): + """IPv6 Circuit Connection properties for global reach. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param address_prefix: /125 IP address space to carve out customer addresses for global reach. + :type address_prefix: str + :ivar circuit_connection_status: Express Route Circuit connection state. Possible values + include: "Connected", "Connecting", "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.CircuitConnectionStatus + """ + + _validation = { + 'circuit_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'circuit_connection_status': {'key': 'circuitConnectionStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + address_prefix: Optional[str] = None, + **kwargs + ): + super(Ipv6CircuitConnectionConfig, self).__init__(**kwargs) + self.address_prefix = address_prefix + self.circuit_connection_status = None + + +class Ipv6ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param state: The state of peering. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'SubResource'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + primary_peer_address_prefix: Optional[str] = None, + secondary_peer_address_prefix: Optional[str] = None, + microsoft_peering_config: Optional["ExpressRouteCircuitPeeringConfig"] = None, + route_filter: Optional["SubResource"] = None, + state: Optional[Union[str, "ExpressRouteCircuitPeeringState"]] = None, + **kwargs + ): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state + + +class ListHubRouteTablesResult(msrest.serialization.Model): + """List of RouteTables and a URL nextLink to get the next set of results. + + :param value: List of RouteTables. + :type value: list[~azure.mgmt.network.v2020_07_01.models.HubRouteTable] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HubRouteTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["HubRouteTable"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListHubRouteTablesResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListHubVirtualNetworkConnectionsResult(msrest.serialization.Model): + """List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + + :param value: List of HubVirtualNetworkConnections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HubVirtualNetworkConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["HubVirtualNetworkConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListHubVirtualNetworkConnectionsResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListP2SVpnGatewaysResult(msrest.serialization.Model): + """Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL nextLink to get the next set of results. + + :param value: List of P2SVpnGateways. + :type value: list[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[P2SVpnGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["P2SVpnGateway"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListP2SVpnGatewaysResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubBgpConnectionResults(msrest.serialization.Model): + """VirtualHubBgpConnections list. + + :param value: The list of VirtualHubBgpConnections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BgpConnection] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BgpConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVirtualHubBgpConnectionResults, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubIpConfigurationResults(msrest.serialization.Model): + """VirtualHubIpConfigurations list. + + :param value: The list of VirtualHubIpConfigurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HubIpConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["HubIpConfiguration"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVirtualHubIpConfigurationResults, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubRouteTableV2SResult(msrest.serialization.Model): + """List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + + :param value: List of VirtualHubRouteTableV2s. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualHubRouteTableV2]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualHubRouteTableV2"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVirtualHubRouteTableV2SResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualHubsResult(msrest.serialization.Model): + """Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set of results. + + :param value: List of VirtualHubs. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualHub] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualHub]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualHub"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVirtualHubsResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVirtualWANsResult(msrest.serialization.Model): + """Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink to get the next set of results. + + :param value: List of VirtualWANs. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualWAN] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualWAN]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualWAN"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVirtualWANsResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnConnectionsResult(msrest.serialization.Model): + """Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections and a URL nextLink to get the next set of results. + + :param value: List of Vpn Connections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnConnection] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVpnConnectionsResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnGatewaysResult(msrest.serialization.Model): + """Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set of results. + + :param value: List of VpnGateways. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnGateway"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVpnGatewaysResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnServerConfigurationsResult(msrest.serialization.Model): + """Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations and a URL nextLink to get the next set of results. + + :param value: List of VpnServerConfigurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnServerConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnServerConfiguration"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVpnServerConfigurationsResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnSiteLinkConnectionsResult(msrest.serialization.Model): + """Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections and a URL nextLink to get the next set of results. + + :param value: List of VpnSiteLinkConnections. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLinkConnection] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnSiteLinkConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnSiteLinkConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVpnSiteLinkConnectionsResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnSiteLinksResult(msrest.serialization.Model): + """Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink to get the next set of results. + + :param value: List of VpnSitesLinks. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLink] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnSiteLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnSiteLink"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVpnSiteLinksResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListVpnSitesResult(msrest.serialization.Model): + """Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the next set of results. + + :param value: List of VpnSites. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnSite] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnSite"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ListVpnSitesResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the load balancer. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.LoadBalancerSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param frontend_ip_configurations: Object representing the frontend IPs to be used for the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by a load balancer. + :type backend_address_pools: list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load balancing rules Gets the + provisioning. + :type load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer. + :type probes: list[~azure.mgmt.network.v2020_07_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load balancer. Defining + inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT + pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are + associated with individual virtual machines cannot reference an Inbound NAT pool. They have to + reference individual inbound NAT rules. + :type inbound_nat_rules: list[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT to a single backend + port on NICs associated with a load balancer. Inbound NAT rules are created automatically for + each NIC associated with the Load Balancer using an external port from this range. Defining an + Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. + Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an inbound NAT pool. They have to reference + individual inbound NAT rules. + :type inbound_nat_pools: list[~azure.mgmt.network.v2020_07_01.models.InboundNatPool] + :param outbound_rules: The outbound rules. + :type outbound_rules: list[~azure.mgmt.network.v2020_07_01.models.OutboundRule] + :ivar resource_guid: The resource GUID property of the load balancer resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the load balancer resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_rules': {'key': 'properties.outboundRules', 'type': '[OutboundRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + sku: Optional["LoadBalancerSku"] = None, + frontend_ip_configurations: Optional[List["FrontendIPConfiguration"]] = None, + backend_address_pools: Optional[List["BackendAddressPool"]] = None, + load_balancing_rules: Optional[List["LoadBalancingRule"]] = None, + probes: Optional[List["Probe"]] = None, + inbound_nat_rules: Optional[List["InboundNatRule"]] = None, + inbound_nat_pools: Optional[List["InboundNatPool"]] = None, + outbound_rules: Optional[List["OutboundRule"]] = None, + **kwargs + ): + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.sku = sku + self.etag = None + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_rules = outbound_rules + self.resource_guid = None + self.provisioning_state = None + + +class LoadBalancerBackendAddress(msrest.serialization.Model): + """Load balancer backend addresses. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of the backend address. + :type name: str + :param virtual_network: Reference to an existing virtual network. + :type virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param ip_address: IP Address belonging to the referenced virtual network. + :type ip_address: str + :ivar network_interface_ip_configuration: Reference to IP address defined in network + interfaces. + :vartype network_interface_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param load_balancer_frontend_ip_configuration: Reference to the frontend ip address + configuration defined in regional loadbalancer. + :type load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _validation = { + 'network_interface_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'network_interface_ip_configuration': {'key': 'properties.networkInterfaceIPConfiguration', 'type': 'SubResource'}, + 'load_balancer_frontend_ip_configuration': {'key': 'properties.loadBalancerFrontendIPConfiguration', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + virtual_network: Optional["SubResource"] = None, + ip_address: Optional[str] = None, + load_balancer_frontend_ip_configuration: Optional["SubResource"] = None, + **kwargs + ): + super(LoadBalancerBackendAddress, self).__init__(**kwargs) + self.name = name + self.virtual_network = virtual_network + self.ip_address = ip_address + self.network_interface_ip_configuration = None + self.load_balancer_frontend_ip_configuration = load_balancer_frontend_ip_configuration + + +class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): + """Response for ListBackendAddressPool API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of backend address pools in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackendAddressPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["BackendAddressPool"]] = None, + **kwargs + ): + super(LoadBalancerBackendAddressPoolListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerFrontendIPConfigurationListResult(msrest.serialization.Model): + """Response for ListFrontendIPConfiguration API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of frontend IP configurations in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FrontendIPConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["FrontendIPConfiguration"]] = None, + **kwargs + ): + super(LoadBalancerFrontendIPConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerListResult(msrest.serialization.Model): + """Response for ListLoadBalancers API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of load balancers in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancer] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["LoadBalancer"]] = None, + **kwargs + ): + super(LoadBalancerListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerLoadBalancingRuleListResult(msrest.serialization.Model): + """Response for ListLoadBalancingRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of load balancing rules in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancingRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancingRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["LoadBalancingRule"]] = None, + **kwargs + ): + super(LoadBalancerLoadBalancingRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerOutboundRuleListResult(msrest.serialization.Model): + """Response for ListOutboundRule API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of outbound rules in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.OutboundRule] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OutboundRule"]] = None, + **kwargs + ): + super(LoadBalancerOutboundRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerProbeListResult(msrest.serialization.Model): + """Response for ListProbe API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of probes in a load balancer. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Probe] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Probe]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Probe"]] = None, + **kwargs + ): + super(LoadBalancerProbeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LoadBalancerSku(msrest.serialization.Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: "Basic", "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.LoadBalancerSkuName + :param tier: Tier of a load balancer SKU. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.LoadBalancerSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "LoadBalancerSkuName"]] = None, + tier: Optional[Union[str, "LoadBalancerSkuTier"]] = None, + **kwargs + ): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of load balancing rules + used by the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound traffic is randomly load + balanced across IPs in the backend IPs. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param probe: The reference to the load balancer probe used by the load balancing rule. + :type probe: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param protocol: The reference to the transport protocol used by the load balancing rule. + Possible values include: "Udp", "Tcp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. Possible values include: + "Default", "SourceIP", "SourceIPProtocol". + :type load_distribution: str or ~azure.mgmt.network.v2020_07_01.models.LoadDistribution + :param frontend_port: The port for the external endpoint. Port numbers for each rule must be + unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 + enables "Any Port". + :type frontend_port: int + :param backend_port: The port used for internal connections on the endpoint. Acceptable values + are between 0 and 65535. Note that value 0 enables "Any Port". + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set + between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the + protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the floating IP + capability required to configure a SQL AlwaysOn Availability Group. This setting is required + when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed + after you create the endpoint. + :type enable_floating_ip: bool + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend pool to use the + publicIP address specified in the frontend of the load balancing rule. + :type disable_outbound_snat: bool + :ivar provisioning_state: The provisioning state of the load balancing rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + frontend_ip_configuration: Optional["SubResource"] = None, + backend_address_pool: Optional["SubResource"] = None, + probe: Optional["SubResource"] = None, + protocol: Optional[Union[str, "TransportProtocol"]] = None, + load_distribution: Optional[Union[str, "LoadDistribution"]] = None, + frontend_port: Optional[int] = None, + backend_port: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_floating_ip: Optional[bool] = None, + enable_tcp_reset: Optional[bool] = None, + disable_outbound_snat: Optional[bool] = None, + **kwargs + ): + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = None + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param local_network_address_space: Local network site address space. + :type local_network_address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param fqdn: FQDN of local network gateway. + :type fqdn: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :ivar resource_guid: The resource GUID property of the local network gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the local network gateway resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + local_network_address_space: Optional["AddressSpace"] = None, + gateway_ip_address: Optional[str] = None, + fqdn: Optional[str] = None, + bgp_settings: Optional["BgpSettings"] = None, + **kwargs + ): + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.fqdn = fqdn + self.bgp_settings = bgp_settings + self.resource_guid = None + self.provisioning_state = None + + +class LocalNetworkGatewayListResult(msrest.serialization.Model): + """Response for ListLocalNetworkGateways API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of local network gateways that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LocalNetworkGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["LocalNetworkGateway"]] = None, + **kwargs + ): + super(LocalNetworkGatewayListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class LogSpecification(msrest.serialization.Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class ManagedRuleGroupOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The managed rule group to override. + :type rule_group_name: str + :param rules: List of rules that will be disabled. If none specified, all rules in the group + will be disabled. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.ManagedRuleOverride] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ManagedRuleOverride]'}, + } + + def __init__( + self, + *, + rule_group_name: str, + rules: Optional[List["ManagedRuleOverride"]] = None, + **kwargs + ): + super(ManagedRuleGroupOverride, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules + + +class ManagedRuleOverride(msrest.serialization.Model): + """Defines a managed rule group override setting. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :param state: The state of the managed rule. Defaults to Disabled if not specified. Possible + values include: "Disabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.ManagedRuleEnabledState + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + rule_id: str, + state: Optional[Union[str, "ManagedRuleEnabledState"]] = None, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = rule_id + self.state = state + + +class ManagedRulesDefinition(msrest.serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to Azure. + + :param exclusions: The Exclusions that are applied on the policy. + :type exclusions: list[~azure.mgmt.network.v2020_07_01.models.OwaspCrsExclusionEntry] + :param managed_rule_sets: Required. The managed rule sets that are associated with the policy. + :type managed_rule_sets: list[~azure.mgmt.network.v2020_07_01.models.ManagedRuleSet] + """ + + _validation = { + 'managed_rule_sets': {'required': True}, + } + + _attribute_map = { + 'exclusions': {'key': 'exclusions', 'type': '[OwaspCrsExclusionEntry]'}, + 'managed_rule_sets': {'key': 'managedRuleSets', 'type': '[ManagedRuleSet]'}, + } + + def __init__( + self, + *, + managed_rule_sets: List["ManagedRuleSet"], + exclusions: Optional[List["OwaspCrsExclusionEntry"]] = None, + **kwargs + ): + super(ManagedRulesDefinition, self).__init__(**kwargs) + self.exclusions = exclusions + self.managed_rule_sets = managed_rule_sets + + +class ManagedRuleSet(msrest.serialization.Model): + """Defines a managed rule set. + + All required parameters must be populated in order to send to Azure. + + :param rule_set_type: Required. Defines the rule set type to use. + :type rule_set_type: str + :param rule_set_version: Required. Defines the version of the rule set to use. + :type rule_set_version: str + :param rule_group_overrides: Defines the rule group overrides to apply to the rule set. + :type rule_group_overrides: + list[~azure.mgmt.network.v2020_07_01.models.ManagedRuleGroupOverride] + """ + + _validation = { + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'rule_group_overrides': {'key': 'ruleGroupOverrides', 'type': '[ManagedRuleGroupOverride]'}, + } + + def __init__( + self, + *, + rule_set_type: str, + rule_set_version: str, + rule_group_overrides: Optional[List["ManagedRuleGroupOverride"]] = None, + **kwargs + ): + super(ManagedRuleSet, self).__init__(**kwargs) + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_group_overrides = rule_group_overrides + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity. This property will only + be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the resource. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user assigned + identities. The type 'None' will remove any identities from the virtual machine. Possible + values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.network.v2020_07_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.network.v2020_07_01.models.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class MatchCondition(msrest.serialization.Model): + """Define match conditions. + + All required parameters must be populated in order to send to Azure. + + :param match_variables: Required. List of match variables. + :type match_variables: list[~azure.mgmt.network.v2020_07_01.models.MatchVariable] + :param operator: Required. The operator to be matched. Possible values include: "IPMatch", + "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual", "GreaterThanOrEqual", + "BeginsWith", "EndsWith", "Regex", "GeoMatch". + :type operator: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallOperator + :param negation_conditon: Whether this is negate condition or not. + :type negation_conditon: bool + :param match_values: Required. Match value. + :type match_values: list[str] + :param transforms: List of transforms. + :type transforms: list[str or + ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallTransform] + """ + + _validation = { + 'match_variables': {'required': True}, + 'operator': {'required': True}, + 'match_values': {'required': True}, + } + + _attribute_map = { + 'match_variables': {'key': 'matchVariables', 'type': '[MatchVariable]'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'negation_conditon': {'key': 'negationConditon', 'type': 'bool'}, + 'match_values': {'key': 'matchValues', 'type': '[str]'}, + 'transforms': {'key': 'transforms', 'type': '[str]'}, + } + + def __init__( + self, + *, + match_variables: List["MatchVariable"], + operator: Union[str, "WebApplicationFirewallOperator"], + match_values: List[str], + negation_conditon: Optional[bool] = None, + transforms: Optional[List[Union[str, "WebApplicationFirewallTransform"]]] = None, + **kwargs + ): + super(MatchCondition, self).__init__(**kwargs) + self.match_variables = match_variables + self.operator = operator + self.negation_conditon = negation_conditon + self.match_values = match_values + self.transforms = transforms + + +class MatchedRule(msrest.serialization.Model): + """Matched rule. + + :param rule_name: Name of the matched network security rule. + :type rule_name: str + :param action: The network traffic is allowed or denied. Possible values are 'Allow' and + 'Deny'. + :type action: str + """ + + _attribute_map = { + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + rule_name: Optional[str] = None, + action: Optional[str] = None, + **kwargs + ): + super(MatchedRule, self).__init__(**kwargs) + self.rule_name = rule_name + self.action = action + + +class MatchVariable(msrest.serialization.Model): + """Define match variables. + + All required parameters must be populated in order to send to Azure. + + :param variable_name: Required. Match Variable. Possible values include: "RemoteAddr", + "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeaders", "RequestBody", + "RequestCookies". + :type variable_name: str or + ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallMatchVariable + :param selector: The selector of match variable. + :type selector: str + """ + + _validation = { + 'variable_name': {'required': True}, + } + + _attribute_map = { + 'variable_name': {'key': 'variableName', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__( + self, + *, + variable_name: Union[str, "WebApplicationFirewallMatchVariable"], + selector: Optional[str] = None, + **kwargs + ): + super(MatchVariable, self).__init__(**kwargs) + self.variable_name = variable_name + self.selector = selector + + +class MetricSpecification(msrest.serialization.Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: list[~azure.mgmt.network.v2020_07_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2020_07_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + availabilities: Optional[List["Availability"]] = None, + enable_regional_mdm_account: Optional[bool] = None, + fill_gap_with_zero: Optional[bool] = None, + metric_filter_pattern: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + is_internal: Optional[bool] = None, + source_mdm_account: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.enable_regional_mdm_account = enable_regional_mdm_account + self.fill_gap_with_zero = fill_gap_with_zero + self.metric_filter_pattern = metric_filter_pattern + self.dimensions = dimensions + self.is_internal = is_internal + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NatGateway(Resource): + """Nat Gateway resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The nat gateway SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.NatGatewaySku + :param zones: A list of availability zones denoting the zone in which Nat Gateway should be + deployed. + :type zones: list[str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param idle_timeout_in_minutes: The idle timeout of the nat gateway. + :type idle_timeout_in_minutes: int + :param public_ip_addresses: An array of public ip addresses associated with the nat gateway + resource. + :type public_ip_addresses: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param public_ip_prefixes: An array of public ip prefixes associated with the nat gateway + resource. + :type public_ip_prefixes: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar resource_guid: The resource GUID property of the NAT gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the NAT gateway resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnets': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'NatGatewaySku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'public_ip_addresses': {'key': 'properties.publicIpAddresses', 'type': '[SubResource]'}, + 'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[SubResource]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["NatGatewaySku"] = None, + zones: Optional[List[str]] = None, + idle_timeout_in_minutes: Optional[int] = None, + public_ip_addresses: Optional[List["SubResource"]] = None, + public_ip_prefixes: Optional[List["SubResource"]] = None, + **kwargs + ): + super(NatGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.zones = zones + self.etag = None + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.public_ip_addresses = public_ip_addresses + self.public_ip_prefixes = public_ip_prefixes + self.subnets = None + self.resource_guid = None + self.provisioning_state = None + + +class NatGatewayListResult(msrest.serialization.Model): + """Response for ListNatGateways API service call. + + :param value: A list of Nat Gateways that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NatGateway] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NatGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NatGateway"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(NatGatewayListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NatGatewaySku(msrest.serialization.Model): + """SKU of nat gateway. + + :param name: Name of Nat Gateway SKU. Possible values include: "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.NatGatewaySkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "NatGatewaySkuName"]] = None, + **kwargs + ): + super(NatGatewaySku, self).__init__(**kwargs) + self.name = name + + +class NatRule(FirewallPolicyRule): + """Rule of type nat. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleNetworkProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or Service Tags. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param translated_address: The translated address for this NAT rule. + :type translated_address: str + :param translated_port: The translated port for this NAT rule. + :type translated_port: str + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param translated_fqdn: The translated FQDN for this NAT rule. + :type translated_fqdn: str + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'ip_protocols': {'key': 'ipProtocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'translated_address': {'key': 'translatedAddress', 'type': 'str'}, + 'translated_port': {'key': 'translatedPort', 'type': 'str'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'translated_fqdn': {'key': 'translatedFqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + ip_protocols: Optional[List[Union[str, "FirewallPolicyRuleNetworkProtocol"]]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + translated_address: Optional[str] = None, + translated_port: Optional[str] = None, + source_ip_groups: Optional[List[str]] = None, + translated_fqdn: Optional[str] = None, + **kwargs + ): + super(NatRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type = 'NatRule' # type: str + self.ip_protocols = ip_protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.translated_address = translated_address + self.translated_port = translated_port + self.source_ip_groups = source_ip_groups + self.translated_fqdn = translated_fqdn + + +class NetworkConfigurationDiagnosticParameters(msrest.serialization.Model): + """Parameters to get network configuration diagnostic. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to perform network + configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and + Application Gateway. + :type target_resource_id: str + :param verbosity_level: Verbosity level. Possible values include: "Normal", "Minimum", "Full". + :type verbosity_level: str or ~azure.mgmt.network.v2020_07_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic profiles. + :type profiles: + list[~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticProfile] + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'profiles': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'verbosity_level': {'key': 'verbosityLevel', 'type': 'str'}, + 'profiles': {'key': 'profiles', 'type': '[NetworkConfigurationDiagnosticProfile]'}, + } + + def __init__( + self, + *, + target_resource_id: str, + profiles: List["NetworkConfigurationDiagnosticProfile"], + verbosity_level: Optional[Union[str, "VerbosityLevel"]] = None, + **kwargs + ): + super(NetworkConfigurationDiagnosticParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.verbosity_level = verbosity_level + self.profiles = profiles + + +class NetworkConfigurationDiagnosticProfile(msrest.serialization.Model): + """Parameters to compare with network configuration. + + All required parameters must be populated in order to send to Azure. + + :param direction: Required. The direction of the traffic. Possible values include: "Inbound", + "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.Direction + :param protocol: Required. Protocol to be verified on. Accepted values are '*', TCP, UDP. + :type protocol: str + :param source: Required. Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + :type source: str + :param destination: Required. Traffic destination. Accepted values are: '*', IP Address/CIDR, + Service Tag. + :type destination: str + :param destination_port: Required. Traffic destination port. Accepted values are '*' and a + single port in the range (0 - 65535). + :type destination_port: str + """ + + _validation = { + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + 'destination_port': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'destination_port': {'key': 'destinationPort', 'type': 'str'}, + } + + def __init__( + self, + *, + direction: Union[str, "Direction"], + protocol: str, + source: str, + destination: str, + destination_port: str, + **kwargs + ): + super(NetworkConfigurationDiagnosticProfile, self).__init__(**kwargs) + self.direction = direction + self.protocol = protocol + self.source = source + self.destination = destination + self.destination_port = destination_port + + +class NetworkConfigurationDiagnosticResponse(msrest.serialization.Model): + """Results of network configuration diagnostic on the target resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar results: List of network configuration diagnostic results. + :vartype results: + list[~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticResult] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[NetworkConfigurationDiagnosticResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkConfigurationDiagnosticResponse, self).__init__(**kwargs) + self.results = None + + +class NetworkConfigurationDiagnosticResult(msrest.serialization.Model): + """Network configuration diagnostic result corresponded to provided traffic query. + + :param profile: Network configuration diagnostic profile. + :type profile: ~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticProfile + :param network_security_group_result: Network security group result. + :type network_security_group_result: + ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroupResult + """ + + _attribute_map = { + 'profile': {'key': 'profile', 'type': 'NetworkConfigurationDiagnosticProfile'}, + 'network_security_group_result': {'key': 'networkSecurityGroupResult', 'type': 'NetworkSecurityGroupResult'}, + } + + def __init__( + self, + *, + profile: Optional["NetworkConfigurationDiagnosticProfile"] = None, + network_security_group_result: Optional["NetworkSecurityGroupResult"] = None, + **kwargs + ): + super(NetworkConfigurationDiagnosticResult, self).__init__(**kwargs) + self.profile = profile + self.network_security_group_result = network_security_group_result + + +class NetworkIntentPolicy(Resource): + """Network Intent Policy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(NetworkIntentPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + + +class NetworkIntentPolicyConfiguration(msrest.serialization.Model): + """Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. + + :param network_intent_policy_name: The name of the Network Intent Policy for storing in target + subscription. + :type network_intent_policy_name: str + :param source_network_intent_policy: Source network intent policy. + :type source_network_intent_policy: ~azure.mgmt.network.v2020_07_01.models.NetworkIntentPolicy + """ + + _attribute_map = { + 'network_intent_policy_name': {'key': 'networkIntentPolicyName', 'type': 'str'}, + 'source_network_intent_policy': {'key': 'sourceNetworkIntentPolicy', 'type': 'NetworkIntentPolicy'}, + } + + def __init__( + self, + *, + network_intent_policy_name: Optional[str] = None, + source_network_intent_policy: Optional["NetworkIntentPolicy"] = None, + **kwargs + ): + super(NetworkIntentPolicyConfiguration, self).__init__(**kwargs) + self.network_intent_policy_name = network_intent_policy_name + self.source_network_intent_policy = source_network_intent_policy + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the network interface. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar virtual_machine: The reference to a virtual machine. + :vartype virtual_machine: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :ivar private_endpoint: A reference to the private endpoint to which the network interface is + linked. + :vartype private_endpoint: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :param ip_configurations: A list of IPConfigurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceDnsSettings + :ivar mac_address: The MAC address of the network interface. + :vartype mac_address: str + :ivar primary: Whether this is a primary network interface on a virtual machine. + :vartype primary: bool + :param enable_accelerated_networking: If the network interface is accelerated networking + enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on this network + interface. + :type enable_ip_forwarding: bool + :ivar hosted_workloads: A list of references to linked BareMetal resources. + :vartype hosted_workloads: list[str] + :ivar dscp_configuration: A reference to the dscp configuration to which the network interface + is linked. + :vartype dscp_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar resource_guid: The resource GUID property of the network interface resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network interface resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_machine': {'readonly': True}, + 'private_endpoint': {'readonly': True}, + 'tap_configurations': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'primary': {'readonly': True}, + 'hosted_workloads': {'readonly': True}, + 'dscp_configuration': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'tap_configurations': {'key': 'properties.tapConfigurations', 'type': '[NetworkInterfaceTapConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'hosted_workloads': {'key': 'properties.hostedWorkloads', 'type': '[str]'}, + 'dscp_configuration': {'key': 'properties.dscpConfiguration', 'type': 'SubResource'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + network_security_group: Optional["NetworkSecurityGroup"] = None, + ip_configurations: Optional[List["NetworkInterfaceIPConfiguration"]] = None, + dns_settings: Optional["NetworkInterfaceDnsSettings"] = None, + enable_accelerated_networking: Optional[bool] = None, + enable_ip_forwarding: Optional[bool] = None, + **kwargs + ): + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.virtual_machine = None + self.network_security_group = network_security_group + self.private_endpoint = None + self.ip_configurations = ip_configurations + self.tap_configurations = None + self.dns_settings = dns_settings + self.mac_address = None + self.primary = None + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.hosted_workloads = None + self.dscp_configuration = None + self.resource_guid = None + self.provisioning_state = None + + +class NetworkInterfaceAssociation(msrest.serialization.Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__( + self, + *, + security_rules: Optional[List["SecurityRule"]] = None, + **kwargs + ): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules + + +class NetworkInterfaceDnsSettings(msrest.serialization.Model): + """DNS settings of a network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param dns_servers: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure + provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be + the only value in dnsServers collection. + :type dns_servers: list[str] + :ivar applied_dns_servers: If the VM that uses this NIC is part of an Availability Set, then + this list will have the union of all DNS servers from all NICs that are part of the + Availability Set. This property is what is configured on each of those VMs. + :vartype applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for internal communications + between VMs in the same virtual network. + :type internal_dns_name_label: str + :ivar internal_fqdn: Fully qualified DNS name supporting internal communications between VMs in + the same virtual network. + :vartype internal_fqdn: str + :ivar internal_domain_name_suffix: Even if internalDnsNameLabel is not specified, a DNS entry + is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the + VM name with the value of internalDomainNameSuffix. + :vartype internal_domain_name_suffix: str + """ + + _validation = { + 'applied_dns_servers': {'readonly': True}, + 'internal_fqdn': {'readonly': True}, + 'internal_domain_name_suffix': {'readonly': True}, + } + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + dns_servers: Optional[List[str]] = None, + internal_dns_name_label: Optional[str] = None, + **kwargs + ): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = None + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = None + self.internal_domain_name_suffix = None + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_network_taps: The reference to Virtual Network Taps. + :type virtual_network_taps: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap] + :param application_gateway_backend_address_pools: The reference to + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference to LoadBalancerBackendAddressPool + resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param primary: Whether this is a primary customer address on the network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which the IP configuration + is included. + :type application_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :ivar provisioning_state: The provisioning state of the network interface IP configuration. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_link_connection_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_network_taps': {'key': 'properties.virtualNetworkTaps', 'type': '[VirtualNetworkTap]'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_link_connection_properties': {'key': 'properties.privateLinkConnectionProperties', 'type': 'NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + virtual_network_taps: Optional[List["VirtualNetworkTap"]] = None, + application_gateway_backend_address_pools: Optional[List["ApplicationGatewayBackendAddressPool"]] = None, + load_balancer_backend_address_pools: Optional[List["BackendAddressPool"]] = None, + load_balancer_inbound_nat_rules: Optional[List["InboundNatRule"]] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + private_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + subnet: Optional["Subnet"] = None, + primary: Optional[bool] = None, + public_ip_address: Optional["PublicIPAddress"] = None, + application_security_groups: Optional[List["ApplicationSecurityGroup"]] = None, + **kwargs + ): + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.virtual_network_taps = virtual_network_taps + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.application_security_groups = application_security_groups + self.provisioning_state = None + self.private_link_connection_properties = None + + +class NetworkInterfaceIPConfigurationListResult(msrest.serialization.Model): + """Response for list ip configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of ip configurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkInterfaceIPConfiguration"]] = None, + **kwargs + ): + super(NetworkInterfaceIPConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(msrest.serialization.Model): + """PrivateLinkConnection properties for the network interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: The group ID for current private link connection. + :vartype group_id: str + :ivar required_member_name: The required member name for current private link connection. + :vartype required_member_name: str + :ivar fqdns: List of FQDNs for current private link connection. + :vartype fqdns: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_member_name': {'readonly': True}, + 'fqdns': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_member_name': {'key': 'requiredMemberName', 'type': 'str'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties, self).__init__(**kwargs) + self.group_id = None + self.required_member_name = None + self.fqdns = None + + +class NetworkInterfaceListResult(msrest.serialization.Model): + """Response for the ListNetworkInterface API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of network interfaces in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkInterface]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkInterface"]] = None, + **kwargs + ): + super(NetworkInterfaceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkInterfaceLoadBalancerListResult(msrest.serialization.Model): + """Response for list ip configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of load balancers. + :type value: list[~azure.mgmt.network.v2020_07_01.models.LoadBalancer] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LoadBalancer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["LoadBalancer"]] = None, + **kwargs + ): + super(NetworkInterfaceLoadBalancerListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkInterfaceTapConfiguration(SubResource): + """Tap configuration in a Network Interface. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Sub Resource type. + :vartype type: str + :param virtual_network_tap: The reference to the Virtual Network Tap resource. + :type virtual_network_tap: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :ivar provisioning_state: The provisioning state of the network interface tap configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_tap': {'key': 'properties.virtualNetworkTap', 'type': 'VirtualNetworkTap'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + virtual_network_tap: Optional["VirtualNetworkTap"] = None, + **kwargs + ): + super(NetworkInterfaceTapConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.virtual_network_tap = virtual_network_tap + self.provisioning_state = None + + +class NetworkInterfaceTapConfigurationListResult(msrest.serialization.Model): + """Response for list tap configurations API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of tap configurations. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkInterfaceTapConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkInterfaceTapConfiguration"]] = None, + **kwargs + ): + super(NetworkInterfaceTapConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkProfile(Resource): + """Network profile resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar container_network_interfaces: List of child container network interfaces. + :vartype container_network_interfaces: + list[~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterface] + :param container_network_interface_configurations: List of chid container network interface + configurations. + :type container_network_interface_configurations: + list[~azure.mgmt.network.v2020_07_01.models.ContainerNetworkInterfaceConfiguration] + :ivar resource_guid: The resource GUID property of the network profile resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network profile resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'container_network_interfaces': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'container_network_interfaces': {'key': 'properties.containerNetworkInterfaces', 'type': '[ContainerNetworkInterface]'}, + 'container_network_interface_configurations': {'key': 'properties.containerNetworkInterfaceConfigurations', 'type': '[ContainerNetworkInterfaceConfiguration]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + container_network_interface_configurations: Optional[List["ContainerNetworkInterfaceConfiguration"]] = None, + **kwargs + ): + super(NetworkProfile, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.container_network_interfaces = None + self.container_network_interface_configurations = container_network_interface_configurations + self.resource_guid = None + self.provisioning_state = None + + +class NetworkProfileListResult(msrest.serialization.Model): + """Response for ListNetworkProfiles API service call. + + :param value: A list of network profiles that exist in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkProfile] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkProfile"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(NetworkProfileListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkRule(FirewallPolicyRule): + """Rule of type network. + + All required parameters must be populated in order to send to Azure. + + :param name: Name of the rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param rule_type: Required. Rule Type.Constant filled by server. Possible values include: + "ApplicationRule", "NetworkRule", "NatRule". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleNetworkProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses or Service Tags. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + :param source_ip_groups: List of source IpGroups for this rule. + :type source_ip_groups: list[str] + :param destination_ip_groups: List of destination IpGroups for this rule. + :type destination_ip_groups: list[str] + :param destination_fqdns: List of destination FQDNs. + :type destination_fqdns: list[str] + """ + + _validation = { + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'ip_protocols': {'key': 'ipProtocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + 'destination_ip_groups': {'key': 'destinationIpGroups', 'type': '[str]'}, + 'destination_fqdns': {'key': 'destinationFqdns', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + ip_protocols: Optional[List[Union[str, "FirewallPolicyRuleNetworkProtocol"]]] = None, + source_addresses: Optional[List[str]] = None, + destination_addresses: Optional[List[str]] = None, + destination_ports: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + destination_ip_groups: Optional[List[str]] = None, + destination_fqdns: Optional[List[str]] = None, + **kwargs + ): + super(NetworkRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type = 'NetworkRule' # type: str + self.ip_protocols = ip_protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports + self.source_ip_groups = source_ip_groups + self.destination_ip_groups = destination_ip_groups + self.destination_fqdns = destination_fqdns + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param security_rules: A collection of security rules of the network security group. + :type security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2020_07_01.models.FlowLog] + :ivar resource_guid: The resource GUID property of the network security group resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the network security group resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'default_security_rules': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + 'flow_logs': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'flow_logs': {'key': 'properties.flowLogs', 'type': '[FlowLog]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + security_rules: Optional[List["SecurityRule"]] = None, + **kwargs + ): + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.security_rules = security_rules + self.default_security_rules = None + self.network_interfaces = None + self.subnets = None + self.flow_logs = None + self.resource_guid = None + self.provisioning_state = None + + +class NetworkSecurityGroupListResult(msrest.serialization.Model): + """Response for ListNetworkSecurityGroups API service call. + + :param value: A list of NetworkSecurityGroup resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkSecurityGroup"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(NetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkSecurityGroupResult(msrest.serialization.Model): + """Network configuration diagnostic result corresponded provided traffic query. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param security_rule_access_result: The network traffic is allowed or denied. Possible values + include: "Allow", "Deny". + :type security_rule_access_result: str or + ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAccess + :ivar evaluated_network_security_groups: List of results network security groups diagnostic. + :vartype evaluated_network_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.EvaluatedNetworkSecurityGroup] + """ + + _validation = { + 'evaluated_network_security_groups': {'readonly': True}, + } + + _attribute_map = { + 'security_rule_access_result': {'key': 'securityRuleAccessResult', 'type': 'str'}, + 'evaluated_network_security_groups': {'key': 'evaluatedNetworkSecurityGroups', 'type': '[EvaluatedNetworkSecurityGroup]'}, + } + + def __init__( + self, + *, + security_rule_access_result: Optional[Union[str, "SecurityRuleAccess"]] = None, + **kwargs + ): + super(NetworkSecurityGroupResult, self).__init__(**kwargs) + self.security_rule_access_result = security_rule_access_result + self.evaluated_network_security_groups = None + + +class NetworkSecurityRulesEvaluationResult(msrest.serialization.Model): + """Network security rules evaluation result. + + :param name: Name of the network security rule. + :type name: str + :param protocol_matched: Value indicating whether protocol is matched. + :type protocol_matched: bool + :param source_matched: Value indicating whether source is matched. + :type source_matched: bool + :param source_port_matched: Value indicating whether source port is matched. + :type source_port_matched: bool + :param destination_matched: Value indicating whether destination is matched. + :type destination_matched: bool + :param destination_port_matched: Value indicating whether destination port is matched. + :type destination_port_matched: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol_matched': {'key': 'protocolMatched', 'type': 'bool'}, + 'source_matched': {'key': 'sourceMatched', 'type': 'bool'}, + 'source_port_matched': {'key': 'sourcePortMatched', 'type': 'bool'}, + 'destination_matched': {'key': 'destinationMatched', 'type': 'bool'}, + 'destination_port_matched': {'key': 'destinationPortMatched', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + protocol_matched: Optional[bool] = None, + source_matched: Optional[bool] = None, + source_port_matched: Optional[bool] = None, + destination_matched: Optional[bool] = None, + destination_port_matched: Optional[bool] = None, + **kwargs + ): + super(NetworkSecurityRulesEvaluationResult, self).__init__(**kwargs) + self.name = name + self.protocol_matched = protocol_matched + self.source_matched = source_matched + self.source_port_matched = source_port_matched + self.destination_matched = destination_matched + self.destination_port_matched = destination_port_matched + + +class NetworkVirtualAppliance(Resource): + """NetworkVirtualAppliance Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param identity: The service principal that has read access to cloud-init and config blob. + :type identity: ~azure.mgmt.network.v2020_07_01.models.ManagedServiceIdentity + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param nva_sku: Network Virtual Appliance SKU. + :type nva_sku: ~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSkuProperties + :ivar address_prefix: Address Prefix. + :vartype address_prefix: str + :param boot_strap_configuration_blobs: BootStrapConfigurationBlobs storage URLs. + :type boot_strap_configuration_blobs: list[str] + :param virtual_hub: The Virtual Hub where Network Virtual Appliance is being deployed. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param cloud_init_configuration_blobs: CloudInitConfigurationBlob storage URLs. + :type cloud_init_configuration_blobs: list[str] + :param cloud_init_configuration: CloudInitConfiguration string in plain text. + :type cloud_init_configuration: str + :param virtual_appliance_asn: VirtualAppliance ASN. + :type virtual_appliance_asn: long + :ivar virtual_appliance_nics: List of Virtual Appliance Network Interfaces. + :vartype virtual_appliance_nics: + list[~azure.mgmt.network.v2020_07_01.models.VirtualApplianceNicProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar inbound_security_rules: List of references to InboundSecurityRules. + :vartype inbound_security_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'address_prefix': {'readonly': True}, + 'virtual_appliance_asn': {'maximum': 4294967295, 'minimum': 0}, + 'virtual_appliance_nics': {'readonly': True}, + 'virtual_appliance_sites': {'readonly': True}, + 'inbound_security_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'nva_sku': {'key': 'properties.nvaSku', 'type': 'VirtualApplianceSkuProperties'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'boot_strap_configuration_blobs': {'key': 'properties.bootStrapConfigurationBlobs', 'type': '[str]'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'cloud_init_configuration_blobs': {'key': 'properties.cloudInitConfigurationBlobs', 'type': '[str]'}, + 'cloud_init_configuration': {'key': 'properties.cloudInitConfiguration', 'type': 'str'}, + 'virtual_appliance_asn': {'key': 'properties.virtualApplianceAsn', 'type': 'long'}, + 'virtual_appliance_nics': {'key': 'properties.virtualApplianceNics', 'type': '[VirtualApplianceNicProperties]'}, + 'virtual_appliance_sites': {'key': 'properties.virtualApplianceSites', 'type': '[SubResource]'}, + 'inbound_security_rules': {'key': 'properties.inboundSecurityRules', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + nva_sku: Optional["VirtualApplianceSkuProperties"] = None, + boot_strap_configuration_blobs: Optional[List[str]] = None, + virtual_hub: Optional["SubResource"] = None, + cloud_init_configuration_blobs: Optional[List[str]] = None, + cloud_init_configuration: Optional[str] = None, + virtual_appliance_asn: Optional[int] = None, + **kwargs + ): + super(NetworkVirtualAppliance, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.identity = identity + self.etag = None + self.nva_sku = nva_sku + self.address_prefix = None + self.boot_strap_configuration_blobs = boot_strap_configuration_blobs + self.virtual_hub = virtual_hub + self.cloud_init_configuration_blobs = cloud_init_configuration_blobs + self.cloud_init_configuration = cloud_init_configuration + self.virtual_appliance_asn = virtual_appliance_asn + self.virtual_appliance_nics = None + self.virtual_appliance_sites = None + self.inbound_security_rules = None + self.provisioning_state = None + + +class NetworkVirtualApplianceListResult(msrest.serialization.Model): + """Response for ListNetworkVirtualAppliances API service call. + + :param value: List of Network Virtual Appliances. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkVirtualAppliance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkVirtualAppliance"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(NetworkVirtualApplianceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkVirtualApplianceSiteListResult(msrest.serialization.Model): + """Response for ListNetworkVirtualApplianceSites API service call. + + :param value: List of Network Virtual Appliance sites. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualApplianceSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualApplianceSite"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(NetworkVirtualApplianceSiteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkVirtualApplianceSku(Resource): + """Definition of the NetworkVirtualApplianceSkus resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar vendor: Network Virtual Appliance Sku vendor. + :vartype vendor: str + :ivar available_versions: Available Network Virtual Appliance versions. + :vartype available_versions: list[str] + :param available_scale_units: The list of scale units available. + :type available_scale_units: + list[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSkuInstances] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'vendor': {'readonly': True}, + 'available_versions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'available_versions': {'key': 'properties.availableVersions', 'type': '[str]'}, + 'available_scale_units': {'key': 'properties.availableScaleUnits', 'type': '[NetworkVirtualApplianceSkuInstances]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + available_scale_units: Optional[List["NetworkVirtualApplianceSkuInstances"]] = None, + **kwargs + ): + super(NetworkVirtualApplianceSku, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.vendor = None + self.available_versions = None + self.available_scale_units = available_scale_units + + +class NetworkVirtualApplianceSkuInstances(msrest.serialization.Model): + """List of available Sku and instances. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar scale_unit: Scale Unit. + :vartype scale_unit: str + :ivar instance_count: Instance Count. + :vartype instance_count: int + """ + + _validation = { + 'scale_unit': {'readonly': True}, + 'instance_count': {'readonly': True}, + } + + _attribute_map = { + 'scale_unit': {'key': 'scaleUnit', 'type': 'str'}, + 'instance_count': {'key': 'instanceCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkVirtualApplianceSkuInstances, self).__init__(**kwargs) + self.scale_unit = None + self.instance_count = None + + +class NetworkVirtualApplianceSkuListResult(msrest.serialization.Model): + """Response for ListNetworkVirtualApplianceSkus API service call. + + :param value: List of Network Virtual Appliance Skus that are available. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSku] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkVirtualApplianceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkVirtualApplianceSku"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(NetworkVirtualApplianceSkuListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the network watcher resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + + +class NetworkWatcherListResult(msrest.serialization.Model): + """Response for ListNetworkWatchers API service call. + + :param value: List of network watcher resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.NetworkWatcher] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkWatcher]'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkWatcher"]] = None, + **kwargs + ): + super(NetworkWatcherListResult, self).__init__(**kwargs) + self.value = value + + +class NextHopParameters(msrest.serialization.Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target resource against + which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is + enabled on any of the nics, then this parameter must be specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + target_resource_id: str, + source_ip_address: str, + destination_ip_address: str, + target_nic_resource_id: Optional[str] = None, + **kwargs + ): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id + + +class NextHopResult(msrest.serialization.Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: "Internet", "VirtualAppliance", + "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", "None". + :type next_hop_type: str or ~azure.mgmt.network.v2020_07_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address. + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table associated with the route + being returned. If the route being returned does not correspond to any user created routes then + this field will be the string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__( + self, + *, + next_hop_type: Optional[Union[str, "NextHopType"]] = None, + next_hop_ip_address: Optional[str] = None, + route_table_id: Optional[str] = None, + **kwargs + ): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id + + +class O365BreakOutCategoryPolicies(msrest.serialization.Model): + """Office365 breakout categories. + + :param allow: Flag to control allow category. + :type allow: bool + :param optimize: Flag to control optimize category. + :type optimize: bool + :param default: Flag to control default category. + :type default: bool + """ + + _attribute_map = { + 'allow': {'key': 'allow', 'type': 'bool'}, + 'optimize': {'key': 'optimize', 'type': 'bool'}, + 'default': {'key': 'default', 'type': 'bool'}, + } + + def __init__( + self, + *, + allow: Optional[bool] = None, + optimize: Optional[bool] = None, + default: Optional[bool] = None, + **kwargs + ): + super(O365BreakOutCategoryPolicies, self).__init__(**kwargs) + self.allow = allow + self.optimize = optimize + self.default = default + + +class O365PolicyProperties(msrest.serialization.Model): + """The Office365 breakout policy. + + :param break_out_categories: Office365 breakout categories. + :type break_out_categories: ~azure.mgmt.network.v2020_07_01.models.O365BreakOutCategoryPolicies + """ + + _attribute_map = { + 'break_out_categories': {'key': 'breakOutCategories', 'type': 'O365BreakOutCategoryPolicies'}, + } + + def __init__( + self, + *, + break_out_categories: Optional["O365BreakOutCategoryPolicies"] = None, + **kwargs + ): + super(O365PolicyProperties, self).__init__(**kwargs) + self.break_out_categories = break_out_categories + + +class Office365PolicyProperties(msrest.serialization.Model): + """Network Virtual Appliance Sku Properties. + + :param break_out_categories: Office 365 breakout categories. + :type break_out_categories: ~azure.mgmt.network.v2020_07_01.models.BreakOutCategoryPolicies + """ + + _attribute_map = { + 'break_out_categories': {'key': 'breakOutCategories', 'type': 'BreakOutCategoryPolicies'}, + } + + def __init__( + self, + *, + break_out_categories: Optional["BreakOutCategoryPolicies"] = None, + **kwargs + ): + super(Office365PolicyProperties, self).__init__(**kwargs) + self.break_out_categories = break_out_categories + + +class Operation(msrest.serialization.Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2020_07_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2020_07_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["OperationPropertiesFormatServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Network operations supported by the Network resource provider. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationPropertiesFormatServiceSpecification(msrest.serialization.Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: list[~azure.mgmt.network.v2020_07_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: list[~azure.mgmt.network.v2020_07_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + log_specifications: Optional[List["LogSpecification"]] = None, + **kwargs + ): + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications + + +class OutboundRule(SubResource): + """Outbound rule of the load balancer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of outbound rules used by + the load balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param allocated_outbound_ports: The number of outbound ports to be used for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load balancer. + :type frontend_ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param backend_address_pool: A reference to a pool of DIPs. Outbound traffic is randomly load + balanced across IPs in the backend IPs. + :type backend_address_pool: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar provisioning_state: The provisioning state of the outbound rule resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param protocol: The protocol for the outbound rule in load balancer. Possible values include: + "Tcp", "Udp", "All". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.LoadBalancerOutboundRuleProtocol + :param enable_tcp_reset: 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. + :type enable_tcp_reset: bool + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + :type idle_timeout_in_minutes: int + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + allocated_outbound_ports: Optional[int] = None, + frontend_ip_configurations: Optional[List["SubResource"]] = None, + backend_address_pool: Optional["SubResource"] = None, + protocol: Optional[Union[str, "LoadBalancerOutboundRuleProtocol"]] = None, + enable_tcp_reset: Optional[bool] = None, + idle_timeout_in_minutes: Optional[int] = None, + **kwargs + ): + super(OutboundRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = None + self.protocol = protocol + self.enable_tcp_reset = enable_tcp_reset + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class OwaspCrsExclusionEntry(msrest.serialization.Model): + """Allow to exclude some variable satisfy the condition for the WAF check. + + All required parameters must be populated in order to send to Azure. + + :param match_variable: Required. The variable to be excluded. Possible values include: + "RequestHeaderNames", "RequestCookieNames", "RequestArgNames". + :type match_variable: str or + ~azure.mgmt.network.v2020_07_01.models.OwaspCrsExclusionEntryMatchVariable + :param selector_match_operator: Required. When matchVariable is a collection, operate on the + selector to specify which elements in the collection this exclusion applies to. Possible values + include: "Equals", "Contains", "StartsWith", "EndsWith", "EqualsAny". + :type selector_match_operator: str or + ~azure.mgmt.network.v2020_07_01.models.OwaspCrsExclusionEntrySelectorMatchOperator + :param selector: Required. When matchVariable is a collection, operator used to specify which + elements in the collection this exclusion applies to. + :type selector: str + """ + + _validation = { + 'match_variable': {'required': True}, + 'selector_match_operator': {'required': True}, + 'selector': {'required': True}, + } + + _attribute_map = { + 'match_variable': {'key': 'matchVariable', 'type': 'str'}, + 'selector_match_operator': {'key': 'selectorMatchOperator', 'type': 'str'}, + 'selector': {'key': 'selector', 'type': 'str'}, + } + + def __init__( + self, + *, + match_variable: Union[str, "OwaspCrsExclusionEntryMatchVariable"], + selector_match_operator: Union[str, "OwaspCrsExclusionEntrySelectorMatchOperator"], + selector: str, + **kwargs + ): + super(OwaspCrsExclusionEntry, self).__init__(**kwargs) + self.match_variable = match_variable + self.selector_match_operator = selector_match_operator + self.selector = selector + + +class P2SConnectionConfiguration(SubResource): + """P2SConnectionConfiguration Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :type vpn_client_address_pool: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + :param enable_internet_security: Flag indicating whether the enable internet security flag is + turned on for the P2S Connections or not. + :type enable_internet_security: bool + :ivar provisioning_state: The provisioning state of the P2SConnectionConfiguration resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'vpn_client_address_pool': {'key': 'properties.vpnClientAddressPool', 'type': 'AddressSpace'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + vpn_client_address_pool: Optional["AddressSpace"] = None, + routing_configuration: Optional["RoutingConfiguration"] = None, + enable_internet_security: Optional[bool] = None, + **kwargs + ): + super(P2SConnectionConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.vpn_client_address_pool = vpn_client_address_pool + self.routing_configuration = routing_configuration + self.enable_internet_security = enable_internet_security + self.provisioning_state = None + + +class P2SVpnConnectionHealth(msrest.serialization.Model): + """P2S Vpn connection detailed health written to sas url. + + :param sas_url: Returned sas url of the blob to which the p2s vpn connection detailed health + will be written. + :type sas_url: str + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + **kwargs + ): + super(P2SVpnConnectionHealth, self).__init__(**kwargs) + self.sas_url = sas_url + + +class P2SVpnConnectionHealthRequest(msrest.serialization.Model): + """List of P2S Vpn connection health request. + + :param vpn_user_names_filter: The list of p2s vpn user names whose p2s vpn connection detailed + health to retrieve for. + :type vpn_user_names_filter: list[str] + :param output_blob_sas_url: The sas-url to download the P2S Vpn connection health detail. + :type output_blob_sas_url: str + """ + + _attribute_map = { + 'vpn_user_names_filter': {'key': 'vpnUserNamesFilter', 'type': '[str]'}, + 'output_blob_sas_url': {'key': 'outputBlobSasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + vpn_user_names_filter: Optional[List[str]] = None, + output_blob_sas_url: Optional[str] = None, + **kwargs + ): + super(P2SVpnConnectionHealthRequest, self).__init__(**kwargs) + self.vpn_user_names_filter = vpn_user_names_filter + self.output_blob_sas_url = output_blob_sas_url + + +class P2SVpnConnectionRequest(msrest.serialization.Model): + """List of p2s vpn connections to be disconnected. + + :param vpn_connection_ids: List of p2s vpn connection Ids. + :type vpn_connection_ids: list[str] + """ + + _attribute_map = { + 'vpn_connection_ids': {'key': 'vpnConnectionIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + vpn_connection_ids: Optional[List[str]] = None, + **kwargs + ): + super(P2SVpnConnectionRequest, self).__init__(**kwargs) + self.vpn_connection_ids = vpn_connection_ids + + +class P2SVpnGateway(Resource): + """P2SVpnGateway Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_hub: The VirtualHub to which the gateway belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param p2_s_connection_configurations: List of all p2s connection configurations of the + gateway. + :type p2_s_connection_configurations: + list[~azure.mgmt.network.v2020_07_01.models.P2SConnectionConfiguration] + :ivar provisioning_state: The provisioning state of the P2S VPN gateway resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param vpn_gateway_scale_unit: The scale unit for this p2s vpn gateway. + :type vpn_gateway_scale_unit: int + :param vpn_server_configuration: The VpnServerConfiguration to which the p2sVpnGateway is + attached to. + :type vpn_server_configuration: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2020_07_01.models.VpnClientConnectionHealth + :param custom_dns_servers: List of all customer specified DNS servers IP addresses. + :type custom_dns_servers: list[str] + :param is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the P2SVpnGateway. + :type is_routing_preference_internet: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'vpn_client_connection_health': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'p2_s_connection_configurations': {'key': 'properties.p2SConnectionConfigurations', 'type': '[P2SConnectionConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vpn_gateway_scale_unit': {'key': 'properties.vpnGatewayScaleUnit', 'type': 'int'}, + 'vpn_server_configuration': {'key': 'properties.vpnServerConfiguration', 'type': 'SubResource'}, + 'vpn_client_connection_health': {'key': 'properties.vpnClientConnectionHealth', 'type': 'VpnClientConnectionHealth'}, + 'custom_dns_servers': {'key': 'properties.customDnsServers', 'type': '[str]'}, + 'is_routing_preference_internet': {'key': 'properties.isRoutingPreferenceInternet', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_hub: Optional["SubResource"] = None, + p2_s_connection_configurations: Optional[List["P2SConnectionConfiguration"]] = None, + vpn_gateway_scale_unit: Optional[int] = None, + vpn_server_configuration: Optional["SubResource"] = None, + custom_dns_servers: Optional[List[str]] = None, + is_routing_preference_internet: Optional[bool] = None, + **kwargs + ): + super(P2SVpnGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_hub = virtual_hub + self.p2_s_connection_configurations = p2_s_connection_configurations + self.provisioning_state = None + self.vpn_gateway_scale_unit = vpn_gateway_scale_unit + self.vpn_server_configuration = vpn_server_configuration + self.vpn_client_connection_health = None + self.custom_dns_servers = custom_dns_servers + self.is_routing_preference_internet = is_routing_preference_internet + + +class P2SVpnProfileParameters(msrest.serialization.Model): + """Vpn Client Parameters for package generation. + + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_07_01.models.AuthenticationMethod + """ + + _attribute_map = { + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + authentication_method: Optional[Union[str, "AuthenticationMethod"]] = None, + **kwargs + ): + super(P2SVpnProfileParameters, self).__init__(**kwargs) + self.authentication_method = authentication_method + + +class PacketCapture(msrest.serialization.Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: Required. The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__( + self, + *, + target: str, + storage_location: "PacketCaptureStorageLocation", + bytes_to_capture_per_packet: Optional[int] = 0, + total_bytes_per_session: Optional[int] = 1073741824, + time_limit_in_seconds: Optional[int] = 18000, + filters: Optional[List["PacketCaptureFilter"]] = None, + **kwargs + ): + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + + +class PacketCaptureFilter(msrest.serialization.Model): + """Filter that is applied to packet capture request. Multiple filters can be applied. + + :param protocol: Protocol to be filtered on. Possible values include: "TCP", "UDP", "Any". + Default value: "Any". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single + address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple entries not currently + supported. Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for single port entry."80-85" + for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing + ranges with multiple entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "PcProtocol"]] = "Any", + local_ip_address: Optional[str] = None, + remote_ip_address: Optional[str] = None, + local_port: Optional[str] = None, + remote_port: Optional[str] = None, + **kwargs + ): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port + + +class PacketCaptureListResult(msrest.serialization.Model): + """List of packet capture sessions. + + :param value: Information about packet capture sessions. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PacketCaptureResult]'}, + } + + def __init__( + self, + *, + value: Optional[List["PacketCaptureResult"]] = None, + **kwargs + ): + super(PacketCaptureListResult, self).__init__(**kwargs) + self.value = value + + +class PacketCaptureParameters(msrest.serialization.Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: Required. The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__( + self, + *, + target: str, + storage_location: "PacketCaptureStorageLocation", + bytes_to_capture_per_packet: Optional[int] = 0, + total_bytes_per_session: Optional[int] = 1073741824, + time_limit_in_seconds: Optional[int] = 18000, + filters: Optional[List["PacketCaptureFilter"]] = None, + **kwargs + ): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + + +class PacketCaptureQueryStatusResult(msrest.serialization.Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: ~datetime.datetime + :param packet_capture_status: The status of the packet capture session. Possible values + include: "NotStarted", "Running", "Stopped", "Error", "Unknown". + :type packet_capture_status: str or ~azure.mgmt.network.v2020_07_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or ~azure.mgmt.network.v2020_07_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, + capture_start_time: Optional[datetime.datetime] = None, + packet_capture_status: Optional[Union[str, "PcStatus"]] = None, + stop_reason: Optional[str] = None, + packet_capture_error: Optional[List[Union[str, "PcError"]]] = None, + **kwargs + ): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error + + +class PacketCaptureResult(msrest.serialization.Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param target: The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + :ivar provisioning_state: The provisioning state of the packet capture session. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + target: Optional[str] = None, + bytes_to_capture_per_packet: Optional[int] = 0, + total_bytes_per_session: Optional[int] = 1073741824, + time_limit_in_seconds: Optional[int] = 18000, + storage_location: Optional["PacketCaptureStorageLocation"] = None, + filters: Optional[List["PacketCaptureFilter"]] = None, + **kwargs + ): + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = None + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = None + + +class PacketCaptureResultProperties(PacketCaptureParameters): + """The properties of a packet capture session. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes + are truncated. + :type bytes_to_capture_per_packet: long + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: long + :param time_limit_in_seconds: Maximum duration of the capture session in seconds. + :type time_limit_in_seconds: int + :param storage_location: Required. The storage location for a packet capture session. + :type storage_location: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_07_01.models.PacketCaptureFilter] + :ivar provisioning_state: The provisioning state of the packet capture session. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'target': {'required': True}, + 'bytes_to_capture_per_packet': {'maximum': 4294967295, 'minimum': 0}, + 'total_bytes_per_session': {'maximum': 4294967295, 'minimum': 0}, + 'time_limit_in_seconds': {'maximum': 18000, 'minimum': 0}, + 'storage_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'long'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'long'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + target: str, + storage_location: "PacketCaptureStorageLocation", + bytes_to_capture_per_packet: Optional[int] = 0, + total_bytes_per_session: Optional[int] = 1073741824, + time_limit_in_seconds: Optional[int] = 18000, + filters: Optional[List["PacketCaptureFilter"]] = None, + **kwargs + ): + super(PacketCaptureResultProperties, self).__init__(target=target, bytes_to_capture_per_packet=bytes_to_capture_per_packet, total_bytes_per_session=total_bytes_per_session, time_limit_in_seconds=time_limit_in_seconds, storage_location=storage_location, filters=filters, **kwargs) + self.provisioning_state = None + + +class PacketCaptureStorageLocation(msrest.serialization.Model): + """The storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet capture session. Required + if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet capture. Must be a well- + formed URI describing the location to save the packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the name of the capture + file (*.cap). For linux virtual machine it must start with /var/captures. Required if no + storage ID is provided, otherwise optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_id: Optional[str] = None, + storage_path: Optional[str] = None, + file_path: Optional[str] = None, + **kwargs + ): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route filter. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the route filter resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peerings': {'readonly': True}, + 'ipv6_peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'ipv6_peerings': {'key': 'properties.ipv6Peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + rules: Optional[List["RouteFilterRule"]] = None, + **kwargs + ): + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.type = None + self.tags = tags + self.rules = rules + self.peerings = None + self.ipv6_peerings = None + self.provisioning_state = None + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param access: The access type of the rule. Possible values include: "Allow", "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.Access + :param route_filter_rule_type: The rule type of the rule. Possible values include: "Community". + :type route_filter_rule_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteFilterRuleType + :param communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the route filter rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + access: Optional[Union[str, "Access"]] = None, + route_filter_rule_type: Optional[Union[str, "RouteFilterRuleType"]] = None, + communities: Optional[List[str]] = None, + **kwargs + ): + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.access = access + self.route_filter_rule_type = route_filter_rule_type + self.communities = communities + self.provisioning_state = None + + +class PeerExpressRouteCircuitConnection(SubResource): + """Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :param express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the circuit. + :type express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param peer_express_route_circuit_peering: Reference to Express Route Circuit Private Peering + Resource of the peered circuit. + :type peer_express_route_circuit_peering: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param address_prefix: /29 IP address space to carve out Customer addresses for tunnels. + :type address_prefix: str + :ivar circuit_connection_status: Express Route Circuit connection state. Possible values + include: "Connected", "Connecting", "Disconnected". + :vartype circuit_connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.CircuitConnectionStatus + :param connection_name: The name of the express route circuit connection resource. + :type connection_name: str + :param auth_resource_guid: The resource guid of the authorization used for the express route + circuit connection. + :type auth_resource_guid: str + :ivar provisioning_state: The provisioning state of the peer express route circuit connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'express_route_circuit_peering': {'key': 'properties.expressRouteCircuitPeering', 'type': 'SubResource'}, + 'peer_express_route_circuit_peering': {'key': 'properties.peerExpressRouteCircuitPeering', 'type': 'SubResource'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'connection_name': {'key': 'properties.connectionName', 'type': 'str'}, + 'auth_resource_guid': {'key': 'properties.authResourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + express_route_circuit_peering: Optional["SubResource"] = None, + peer_express_route_circuit_peering: Optional["SubResource"] = None, + address_prefix: Optional[str] = None, + connection_name: Optional[str] = None, + auth_resource_guid: Optional[str] = None, + **kwargs + ): + super(PeerExpressRouteCircuitConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.express_route_circuit_peering = express_route_circuit_peering + self.peer_express_route_circuit_peering = peer_express_route_circuit_peering + self.address_prefix = address_prefix + self.circuit_connection_status = None + self.connection_name = connection_name + self.auth_resource_guid = auth_resource_guid + self.provisioning_state = None + + +class PeerExpressRouteCircuitConnectionListResult(msrest.serialization.Model): + """Response for ListPeeredConnections API service call retrieves all global reach peer circuit connections that belongs to a Private Peering for an ExpressRouteCircuit. + + :param value: The global reach peer circuit connection associated with Private Peering in an + ExpressRoute Circuit. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnection] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PeerExpressRouteCircuitConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PeerExpressRouteCircuitConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PeerExpressRouteCircuitConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PeerRoute(msrest.serialization.Model): + """Peer routing details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar local_address: The peer's local address. + :vartype local_address: str + :ivar network: The route's network prefix. + :vartype network: str + :ivar next_hop: The route's next hop. + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from. + :vartype source_peer: str + :ivar origin: The source this route was learned from. + :vartype origin: str + :ivar as_path: The route's AS path sequence. + :vartype as_path: str + :ivar weight: The route's weight. + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PeerRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None + + +class PeerRouteList(msrest.serialization.Model): + """List of virtual router peer routes. + + :param value: List of peer routes. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PeerRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PeerRoute]'}, + } + + def __init__( + self, + *, + value: Optional[List["PeerRoute"]] = None, + **kwargs + ): + super(PeerRouteList, self).__init__(**kwargs) + self.value = value + + +class PolicySettings(msrest.serialization.Model): + """Defines contents of a web application firewall global configuration. + + :param state: The state of the policy. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallEnabledState + :param mode: The mode of the policy. Possible values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallMode + :param request_body_check: Whether to allow WAF to check request Body. + :type request_body_check: bool + :param max_request_body_size_in_kb: Maximum request body size in Kb for WAF. + :type max_request_body_size_in_kb: int + :param file_upload_limit_in_mb: Maximum file upload size in Mb for WAF. + :type file_upload_limit_in_mb: int + """ + + _validation = { + 'max_request_body_size_in_kb': {'maximum': 128, 'minimum': 8}, + 'file_upload_limit_in_mb': {'minimum': 0}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'bool'}, + 'max_request_body_size_in_kb': {'key': 'maxRequestBodySizeInKb', 'type': 'int'}, + 'file_upload_limit_in_mb': {'key': 'fileUploadLimitInMb', 'type': 'int'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "WebApplicationFirewallEnabledState"]] = None, + mode: Optional[Union[str, "WebApplicationFirewallMode"]] = None, + request_body_check: Optional[bool] = None, + max_request_body_size_in_kb: Optional[int] = None, + file_upload_limit_in_mb: Optional[int] = None, + **kwargs + ): + super(PolicySettings, self).__init__(**kwargs) + self.state = state + self.mode = mode + self.request_body_check = request_body_check + self.max_request_body_size_in_kb = max_request_body_size_in_kb + self.file_upload_limit_in_mb = file_upload_limit_in_mb + + +class PrepareNetworkPoliciesRequest(msrest.serialization.Model): + """Details of PrepareNetworkPolicies for Subnet. + + :param service_name: The name of the service for which subnet is being prepared for. + :type service_name: str + :param network_intent_policy_configurations: A list of NetworkIntentPolicyConfiguration. + :type network_intent_policy_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkIntentPolicyConfiguration] + """ + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'network_intent_policy_configurations': {'key': 'networkIntentPolicyConfigurations', 'type': '[NetworkIntentPolicyConfiguration]'}, + } + + def __init__( + self, + *, + service_name: Optional[str] = None, + network_intent_policy_configurations: Optional[List["NetworkIntentPolicyConfiguration"]] = None, + **kwargs + ): + super(PrepareNetworkPoliciesRequest, self).__init__(**kwargs) + self.service_name = service_name + self.network_intent_policy_configurations = network_intent_policy_configurations + + +class PrivateDnsZoneConfig(msrest.serialization.Model): + """PrivateDnsZoneConfig resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :param private_dns_zone_id: The resource id of the private dns zone. + :type private_dns_zone_id: str + :ivar record_sets: A collection of information regarding a recordSet, holding information to + identify private resources. + :vartype record_sets: list[~azure.mgmt.network.v2020_07_01.models.RecordSet] + """ + + _validation = { + 'record_sets': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_dns_zone_id': {'key': 'properties.privateDnsZoneId', 'type': 'str'}, + 'record_sets': {'key': 'properties.recordSets', 'type': '[RecordSet]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + private_dns_zone_id: Optional[str] = None, + **kwargs + ): + super(PrivateDnsZoneConfig, self).__init__(**kwargs) + self.name = name + self.private_dns_zone_id = private_dns_zone_id + self.record_sets = None + + +class PrivateDnsZoneGroup(SubResource): + """Private dns zone group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private dns zone group resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_dns_zone_configs: A collection of private dns zone configurations of the private + dns zone group. + :type private_dns_zone_configs: + list[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneConfig] + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_dns_zone_configs': {'key': 'properties.privateDnsZoneConfigs', 'type': '[PrivateDnsZoneConfig]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_dns_zone_configs: Optional[List["PrivateDnsZoneConfig"]] = None, + **kwargs + ): + super(PrivateDnsZoneGroup, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.provisioning_state = None + self.private_dns_zone_configs = private_dns_zone_configs + + +class PrivateDnsZoneGroupListResult(msrest.serialization.Model): + """Response for the ListPrivateDnsZoneGroups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of private dns zone group resources in a private endpoint. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateDnsZoneGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateDnsZoneGroup"]] = None, + **kwargs + ): + super(PrivateDnsZoneGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateEndpoint(Resource): + """Private endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param subnet: The ID of the subnet from which the private IP will be allocated. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :ivar network_interfaces: An array of references to the network interfaces created for this + private endpoint. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar provisioning_state: The provisioning state of the private endpoint resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_link_service_connections: A grouping of information about the connection to the + remote resource. + :type private_link_service_connections: + list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnection] + :param manual_private_link_service_connections: A grouping of information about the connection + to the remote resource. Used when the network admin does not have access to approve connections + to the remote resource. + :type manual_private_link_service_connections: + list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnection] + :param custom_dns_configs: An array of custom dns configurations. + :type custom_dns_configs: + list[~azure.mgmt.network.v2020_07_01.models.CustomDnsConfigPropertiesFormat] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_link_service_connections': {'key': 'properties.privateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'manual_private_link_service_connections': {'key': 'properties.manualPrivateLinkServiceConnections', 'type': '[PrivateLinkServiceConnection]'}, + 'custom_dns_configs': {'key': 'properties.customDnsConfigs', 'type': '[CustomDnsConfigPropertiesFormat]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + subnet: Optional["Subnet"] = None, + private_link_service_connections: Optional[List["PrivateLinkServiceConnection"]] = None, + manual_private_link_service_connections: Optional[List["PrivateLinkServiceConnection"]] = None, + custom_dns_configs: Optional[List["CustomDnsConfigPropertiesFormat"]] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.subnet = subnet + self.network_interfaces = None + self.provisioning_state = None + self.private_link_service_connections = private_link_service_connections + self.manual_private_link_service_connections = manual_private_link_service_connections + self.custom_dns_configs = custom_dns_configs + + +class PrivateEndpointConnection(SubResource): + """PrivateEndpointConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar link_identifier: The consumer link id. + :vartype link_identifier: str + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'private_endpoint': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'link_identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'link_identifier': {'key': 'properties.linkIdentifier', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.private_endpoint = None + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + self.link_identifier = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """Response for the ListPrivateEndpointConnection API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of PrivateEndpointConnection resources for a specific private link + service. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateEndpointListResult(msrest.serialization.Model): + """Response for the ListPrivateEndpoints API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of private endpoint resources in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpoint"]] = None, + **kwargs + ): + super(PrivateEndpointListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateLinkService(Resource): + """Private link service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param load_balancer_frontend_ip_configurations: An array of references to the load balancer IP + configurations. + :type load_balancer_frontend_ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration] + :param ip_configurations: An array of private link service IP configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceIpConfiguration] + :ivar network_interfaces: An array of references to the network interfaces created for this + private link service. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :ivar provisioning_state: The provisioning state of the private link service resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar private_endpoint_connections: An array of list about connections to the private endpoint. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection] + :param visibility: The visibility list of the private link service. + :type visibility: ~azure.mgmt.network.v2020_07_01.models.ResourceSet + :param auto_approval: The auto-approval list of the private link service. + :type auto_approval: ~azure.mgmt.network.v2020_07_01.models.ResourceSet + :param fqdns: The list of Fqdn. + :type fqdns: list[str] + :ivar alias: The alias of the private link service. + :vartype alias: str + :param enable_proxy_protocol: Whether the private link service is enabled for proxy protocol or + not. + :type enable_proxy_protocol: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'alias': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'load_balancer_frontend_ip_configurations': {'key': 'properties.loadBalancerFrontendIpConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[PrivateLinkServiceIpConfiguration]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'visibility': {'key': 'properties.visibility', 'type': 'ResourceSet'}, + 'auto_approval': {'key': 'properties.autoApproval', 'type': 'ResourceSet'}, + 'fqdns': {'key': 'properties.fqdns', 'type': '[str]'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'enable_proxy_protocol': {'key': 'properties.enableProxyProtocol', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + load_balancer_frontend_ip_configurations: Optional[List["FrontendIPConfiguration"]] = None, + ip_configurations: Optional[List["PrivateLinkServiceIpConfiguration"]] = None, + visibility: Optional["ResourceSet"] = None, + auto_approval: Optional["ResourceSet"] = None, + fqdns: Optional[List[str]] = None, + enable_proxy_protocol: Optional[bool] = None, + **kwargs + ): + super(PrivateLinkService, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.load_balancer_frontend_ip_configurations = load_balancer_frontend_ip_configurations + self.ip_configurations = ip_configurations + self.network_interfaces = None + self.provisioning_state = None + self.private_endpoint_connections = None + self.visibility = visibility + self.auto_approval = auto_approval + self.fqdns = fqdns + self.alias = None + self.enable_proxy_protocol = enable_proxy_protocol + + +class PrivateLinkServiceConnection(SubResource): + """PrivateLinkServiceConnection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar type: The resource type. + :vartype type: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the private link service connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_link_service_id: The resource id of private link service. + :type private_link_service_id: str + :param group_ids: The ID(s) of the group(s) obtained from the remote resource that this private + endpoint should connect to. + :type group_ids: list[str] + :param request_message: A message passed to the owner of the remote resource with this + connection request. Restricted to 140 chars. + :type request_message: str + :param private_link_service_connection_state: A collection of read-only information about the + state of the connection to the remote resource. + :type private_link_service_connection_state: + ~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_link_service_id': {'key': 'properties.privateLinkServiceId', 'type': 'str'}, + 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, + 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_link_service_id: Optional[str] = None, + group_ids: Optional[List[str]] = None, + request_message: Optional[str] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateLinkServiceConnection, self).__init__(id=id, **kwargs) + self.name = name + self.type = None + self.etag = None + self.provisioning_state = None + self.private_link_service_id = private_link_service_id + self.group_ids = group_ids + self.request_message = request_message + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. + :type status: str + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class PrivateLinkServiceIpConfiguration(SubResource): + """The private link service ip configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of private link service ip configuration. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: The resource type. + :vartype type: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.Subnet + :param primary: Whether the ip configuration is primary or not. + :type primary: bool + :ivar provisioning_state: The provisioning state of the private link service IP configuration + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_ip_address_version: Whether the specific IP configuration is IPv4 or IPv6. + Default is IPv4. Possible values include: "IPv4", "IPv6". + :type private_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_ip_address: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + subnet: Optional["Subnet"] = None, + primary: Optional[bool] = None, + private_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + **kwargs + ): + super(PrivateLinkServiceIpConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.primary = primary + self.provisioning_state = None + self.private_ip_address_version = private_ip_address_version + + +class PrivateLinkServiceListResult(msrest.serialization.Model): + """Response for the ListPrivateLinkService API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of PrivateLinkService resources in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PrivateLinkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkService"]] = None, + **kwargs + ): + super(PrivateLinkServiceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceSet(msrest.serialization.Model): + """The base resource set for visibility and auto-approval. + + :param subscriptions: The list of subscriptions. + :type subscriptions: list[str] + """ + + _attribute_map = { + 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + subscriptions: Optional[List[str]] = None, + **kwargs + ): + super(ResourceSet, self).__init__(**kwargs) + self.subscriptions = subscriptions + + +class PrivateLinkServicePropertiesAutoApproval(ResourceSet): + """The auto-approval list of the private link service. + + :param subscriptions: The list of subscriptions. + :type subscriptions: list[str] + """ + + _attribute_map = { + 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + subscriptions: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkServicePropertiesAutoApproval, self).__init__(subscriptions=subscriptions, **kwargs) + + +class PrivateLinkServicePropertiesVisibility(ResourceSet): + """The visibility list of the private link service. + + :param subscriptions: The list of subscriptions. + :type subscriptions: list[str] + """ + + _attribute_map = { + 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + subscriptions: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkServicePropertiesVisibility, self).__init__(subscriptions=subscriptions, **kwargs) + + +class PrivateLinkServiceVisibility(msrest.serialization.Model): + """Response for the CheckPrivateLinkServiceVisibility API service call. + + :param visible: Private Link Service Visibility (True/False). + :type visible: bool + """ + + _attribute_map = { + 'visible': {'key': 'visible', 'type': 'bool'}, + } + + def __init__( + self, + *, + visible: Optional[bool] = None, + **kwargs + ): + super(PrivateLinkServiceVisibility, self).__init__(**kwargs) + self.visible = visible + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within the set of probes used by the load + balancer. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Type of the resource. + :vartype type: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param protocol: The protocol of the end point. If 'Tcp' is specified, a received ACK is + required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. Possible values include: + "Http", "Tcp", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.ProbeProtocol + :param port: The port for communicating the probe. Possible values range from 1 to 65535, + inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint + for health status. Typically, the interval is slightly less than half the allocated timeout + period (in seconds) which allows two full probes before taking the instance out of rotation. + The default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will result in stopping + further traffic from being delivered to the endpoint. This values allows endpoints to be taken + out of rotation faster or slower than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the VM. Path is required if + a protocol is set to http. Otherwise, it is not allowed. There is no default value. + :type request_path: str + :ivar provisioning_state: The provisioning state of the probe resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + protocol: Optional[Union[str, "ProbeProtocol"]] = None, + port: Optional[int] = None, + interval_in_seconds: Optional[int] = None, + number_of_probes: Optional[int] = None, + request_path: Optional[str] = None, + **kwargs + ): + super(Probe, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = None + + +class PropagatedRouteTable(msrest.serialization.Model): + """The list of RouteTables to advertise the routes to. + + :param labels: The list of labels. + :type labels: list[str] + :param ids: The list of resource ids of all the RouteTables. + :type ids: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _attribute_map = { + 'labels': {'key': 'labels', 'type': '[str]'}, + 'ids': {'key': 'ids', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + labels: Optional[List[str]] = None, + ids: Optional[List["SubResource"]] = None, + **kwargs + ): + super(PropagatedRouteTable, self).__init__(**kwargs) + self.labels = labels + self.ids = ids + + +class ProtocolConfiguration(msrest.serialization.Model): + """Configuration of the protocol. + + :param http_configuration: HTTP configuration of the connectivity check. + :type http_configuration: ~azure.mgmt.network.v2020_07_01.models.HTTPConfiguration + """ + + _attribute_map = { + 'http_configuration': {'key': 'HTTPConfiguration', 'type': 'HTTPConfiguration'}, + } + + def __init__( + self, + *, + http_configuration: Optional["HTTPConfiguration"] = None, + **kwargs + ): + super(ProtocolConfiguration, self).__init__(**kwargs) + self.http_configuration = http_configuration + + +class ProtocolCustomSettingsFormat(msrest.serialization.Model): + """DDoS custom policy properties. + + :param protocol: The protocol for which the DDoS protection policy is being customized. + Possible values include: "Tcp", "Udp", "Syn". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicyProtocol + :param trigger_rate_override: The customized DDoS protection trigger rate. + :type trigger_rate_override: str + :param source_rate_override: The customized DDoS protection source rate. + :type source_rate_override: str + :param trigger_sensitivity_override: The customized DDoS protection trigger rate sensitivity + degrees. High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger + rate set with moderate sensitivity w.r.t. normal traffic. Low: Trigger rate set with less + sensitivity w.r.t. normal traffic. Relaxed: Trigger rate set with least sensitivity w.r.t. + normal traffic. Possible values include: "Relaxed", "Low", "Default", "High". + :type trigger_sensitivity_override: str or + ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicyTriggerSensitivityOverride + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'trigger_rate_override': {'key': 'triggerRateOverride', 'type': 'str'}, + 'source_rate_override': {'key': 'sourceRateOverride', 'type': 'str'}, + 'trigger_sensitivity_override': {'key': 'triggerSensitivityOverride', 'type': 'str'}, + } + + def __init__( + self, + *, + protocol: Optional[Union[str, "DdosCustomPolicyProtocol"]] = None, + trigger_rate_override: Optional[str] = None, + source_rate_override: Optional[str] = None, + trigger_sensitivity_override: Optional[Union[str, "DdosCustomPolicyTriggerSensitivityOverride"]] = None, + **kwargs + ): + super(ProtocolCustomSettingsFormat, self).__init__(**kwargs) + self.protocol = protocol + self.trigger_rate_override = trigger_rate_override + self.source_rate_override = source_rate_override + self.trigger_sensitivity_override = trigger_sensitivity_override + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the public ip address. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :param public_ip_allocation_method: The public IP address allocation method. Possible values + include: "Static", "Dynamic". + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible values include: + "IPv4", "IPv6". + :type public_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2020_07_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public IP address. + :type dns_settings: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressDnsSettings + :param ddos_settings: The DDoS protection custom policy associated with the public IP address. + :type ddos_settings: ~azure.mgmt.network.v2020_07_01.models.DdosSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2020_07_01.models.IpTag] + :param ip_address: The IP address associated with the public IP address resource. + :type ip_address: str + :param public_ip_prefix: The Public IP Prefix this Public IP Address should be allocated from. + :type public_ip_prefix: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :ivar resource_guid: The resource GUID property of the public IP address resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the public IP address resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ddos_settings': {'key': 'properties.ddosSettings', 'type': 'DdosSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'SubResource'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + sku: Optional["PublicIPAddressSku"] = None, + zones: Optional[List[str]] = None, + public_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + public_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + dns_settings: Optional["PublicIPAddressDnsSettings"] = None, + ddos_settings: Optional["DdosSettings"] = None, + ip_tags: Optional[List["IpTag"]] = None, + ip_address: Optional[str] = None, + public_ip_prefix: Optional["SubResource"] = None, + idle_timeout_in_minutes: Optional[int] = None, + **kwargs + ): + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.sku = sku + self.etag = None + self.zones = zones + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ddos_settings = ddos_settings + self.ip_tags = ip_tags + self.ip_address = ip_address + self.public_ip_prefix = public_ip_prefix + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = None + self.provisioning_state = None + + +class PublicIPAddressDnsSettings(msrest.serialization.Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: The domain name label. The concatenation of the domain name label and + the regionalized DNS zone make up the fully qualified domain name associated with the public IP + address. If a domain name label is specified, an A DNS record is created for the public IP in + the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: The Fully Qualified Domain Name of the A DNS record associated with the public IP. + This is the concatenation of the domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: The reverse FQDN. A user-visible, fully qualified domain name that + resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is + created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + domain_name_label: Optional[str] = None, + fqdn: Optional[str] = None, + reverse_fqdn: Optional[str] = None, + **kwargs + ): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn + + +class PublicIPAddressListResult(msrest.serialization.Model): + """Response for ListPublicIpAddresses API service call. + + :param value: A list of public IP addresses that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PublicIPAddress] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicIPAddress]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PublicIPAddress"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PublicIPAddressListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PublicIPAddressSku(msrest.serialization.Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: "Basic", "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressSkuName + :param tier: Tier of a public IP address SKU. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPAddressSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "PublicIPAddressSkuName"]] = None, + tier: Optional[Union[str, "PublicIPAddressSkuTier"]] = None, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class PublicIPPrefix(Resource): + """Public IP prefix resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the public ip address. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :param sku: The public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixSku + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param zones: A list of availability zones denoting the IP allocated for the resource needs to + come from. + :type zones: list[str] + :param public_ip_address_version: The public IP address version. Possible values include: + "IPv4", "IPv6". + :type public_ip_address_version: str or ~azure.mgmt.network.v2020_07_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2020_07_01.models.IpTag] + :param prefix_length: The Length of the Public IP Prefix. + :type prefix_length: int + :ivar ip_prefix: The allocated Prefix. + :vartype ip_prefix: str + :ivar public_ip_addresses: The list of all referenced PublicIPAddresses. + :vartype public_ip_addresses: + list[~azure.mgmt.network.v2020_07_01.models.ReferencedPublicIpAddress] + :ivar load_balancer_frontend_ip_configuration: The reference to load balancer frontend IP + configuration associated with the public IP prefix. + :vartype load_balancer_frontend_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.SubResource + :param custom_ip_prefix: The customIpPrefix that this prefix is associated with. + :type custom_ip_prefix: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar resource_guid: The resource GUID property of the public IP prefix resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the public IP prefix resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'ip_prefix': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'load_balancer_frontend_ip_configuration': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'PublicIPPrefixSku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, + 'ip_prefix': {'key': 'properties.ipPrefix', 'type': 'str'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[ReferencedPublicIpAddress]'}, + 'load_balancer_frontend_ip_configuration': {'key': 'properties.loadBalancerFrontendIpConfiguration', 'type': 'SubResource'}, + 'custom_ip_prefix': {'key': 'properties.customIPPrefix', 'type': 'SubResource'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + sku: Optional["PublicIPPrefixSku"] = None, + zones: Optional[List[str]] = None, + public_ip_address_version: Optional[Union[str, "IPVersion"]] = None, + ip_tags: Optional[List["IpTag"]] = None, + prefix_length: Optional[int] = None, + custom_ip_prefix: Optional["SubResource"] = None, + **kwargs + ): + super(PublicIPPrefix, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.sku = sku + self.etag = None + self.zones = zones + self.public_ip_address_version = public_ip_address_version + self.ip_tags = ip_tags + self.prefix_length = prefix_length + self.ip_prefix = None + self.public_ip_addresses = None + self.load_balancer_frontend_ip_configuration = None + self.custom_ip_prefix = custom_ip_prefix + self.resource_guid = None + self.provisioning_state = None + + +class PublicIPPrefixListResult(msrest.serialization.Model): + """Response for ListPublicIpPrefixes API service call. + + :param value: A list of public IP prefixes that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicIPPrefix]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PublicIPPrefix"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PublicIPPrefixListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PublicIPPrefixSku(msrest.serialization.Model): + """SKU of a public IP prefix. + + :param name: Name of a public IP prefix SKU. Possible values include: "Standard". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixSkuName + :param tier: Tier of a public IP prefix SKU. Possible values include: "Regional", "Global". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixSkuTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "PublicIPPrefixSkuName"]] = None, + tier: Optional[Union[str, "PublicIPPrefixSkuTier"]] = None, + **kwargs + ): + super(PublicIPPrefixSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class QosIpRange(msrest.serialization.Model): + """Qos Traffic Profiler IP Range properties. + + :param start_ip: Start IP Address. + :type start_ip: str + :param end_ip: End IP Address. + :type end_ip: str + """ + + _attribute_map = { + 'start_ip': {'key': 'startIP', 'type': 'str'}, + 'end_ip': {'key': 'endIP', 'type': 'str'}, + } + + def __init__( + self, + *, + start_ip: Optional[str] = None, + end_ip: Optional[str] = None, + **kwargs + ): + super(QosIpRange, self).__init__(**kwargs) + self.start_ip = start_ip + self.end_ip = end_ip + + +class QosPortRange(msrest.serialization.Model): + """Qos Traffic Profiler Port range properties. + + :param start: Qos Port Range start. + :type start: int + :param end: Qos Port Range end. + :type end: int + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'int'}, + 'end': {'key': 'end', 'type': 'int'}, + } + + def __init__( + self, + *, + start: Optional[int] = None, + end: Optional[int] = None, + **kwargs + ): + super(QosPortRange, self).__init__(**kwargs) + self.start = start + self.end = end + + +class QueryTroubleshootingParameters(msrest.serialization.Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting + result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + target_resource_id: str, + **kwargs + ): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + + +class RadiusServer(msrest.serialization.Model): + """Radius Server Settings. + + All required parameters must be populated in order to send to Azure. + + :param radius_server_address: Required. The address of this radius server. + :type radius_server_address: str + :param radius_server_score: The initial score assigned to this radius server. + :type radius_server_score: long + :param radius_server_secret: The secret used for this radius server. + :type radius_server_secret: str + """ + + _validation = { + 'radius_server_address': {'required': True}, + } + + _attribute_map = { + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_score': {'key': 'radiusServerScore', 'type': 'long'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__( + self, + *, + radius_server_address: str, + radius_server_score: Optional[int] = None, + radius_server_secret: Optional[str] = None, + **kwargs + ): + super(RadiusServer, self).__init__(**kwargs) + self.radius_server_address = radius_server_address + self.radius_server_score = radius_server_score + self.radius_server_secret = radius_server_secret + + +class RecordSet(msrest.serialization.Model): + """A collective group of information about the record set information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param record_type: Resource record type. + :type record_type: str + :param record_set_name: Recordset name. + :type record_set_name: str + :param fqdn: Fqdn that resolves to private endpoint ip address. + :type fqdn: str + :ivar provisioning_state: The provisioning state of the recordset. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param ttl: Recordset time to live. + :type ttl: int + :param ip_addresses: The private ip address of the private endpoint. + :type ip_addresses: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'record_type': {'key': 'recordType', 'type': 'str'}, + 'record_set_name': {'key': 'recordSetName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'ttl': {'key': 'ttl', 'type': 'int'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + record_type: Optional[str] = None, + record_set_name: Optional[str] = None, + fqdn: Optional[str] = None, + ttl: Optional[int] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(RecordSet, self).__init__(**kwargs) + self.record_type = record_type + self.record_set_name = record_set_name + self.fqdn = fqdn + self.provisioning_state = None + self.ttl = ttl + self.ip_addresses = ip_addresses + + +class ReferencedPublicIpAddress(msrest.serialization.Model): + """Reference to a public IP address. + + :param id: The PublicIPAddress Reference. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ReferencedPublicIpAddress, self).__init__(**kwargs) + self.id = id + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource. + :type link: str + :ivar provisioning_state: The provisioning state of the resource navigation link resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + linked_resource_type: Optional[str] = None, + link: Optional[str] = None, + **kwargs + ): + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + + +class ResourceNavigationLinksListResult(msrest.serialization.Model): + """Response for ResourceNavigationLinks_List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The resource navigation links in a subnet. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ResourceNavigationLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceNavigationLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ResourceNavigationLink"]] = None, + **kwargs + ): + super(ResourceNavigationLinksListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class RetentionPolicyParameters(msrest.serialization.Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. + :type days: int + :param enabled: Flag to enable/disable retention. + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + days: Optional[int] = 0, + enabled: Optional[bool] = False, + **kwargs + ): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled + + +class Route(SubResource): + """Route resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values + include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". + :type next_hop_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. Next hop values are + only allowed in routes where the next hop type is VirtualAppliance. + :type next_hop_ip_address: str + :ivar provisioning_state: The provisioning state of the route resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + address_prefix: Optional[str] = None, + next_hop_type: Optional[Union[str, "RouteNextHopType"]] = None, + next_hop_ip_address: Optional[str] = None, + **kwargs + ): + super(Route, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = None + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param rules: Collection of RouteFilterRules contained within a route filter. + :type rules: list[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the route filter resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'peerings': {'readonly': True}, + 'ipv6_peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'ipv6_peerings': {'key': 'properties.ipv6Peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + rules: Optional[List["RouteFilterRule"]] = None, + **kwargs + ): + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.rules = rules + self.peerings = None + self.ipv6_peerings = None + self.provisioning_state = None + + +class RouteFilterListResult(msrest.serialization.Model): + """Response for the ListRouteFilters API service call. + + :param value: A list of route filters in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.RouteFilter] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RouteFilter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RouteFilter"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RouteFilterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param access: The access type of the rule. Possible values include: "Allow", "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.Access + :param route_filter_rule_type: The rule type of the rule. Possible values include: "Community". + :type route_filter_rule_type: str or ~azure.mgmt.network.v2020_07_01.models.RouteFilterRuleType + :param communities: The collection for bgp community values to filter on. e.g. + ['12076:5010','12076:5020']. + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the route filter rule resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + location: Optional[str] = None, + access: Optional[Union[str, "Access"]] = None, + route_filter_rule_type: Optional[Union[str, "RouteFilterRuleType"]] = None, + communities: Optional[List[str]] = None, + **kwargs + ): + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.name = name + self.location = location + self.etag = None + self.access = access + self.route_filter_rule_type = route_filter_rule_type + self.communities = communities + self.provisioning_state = None + + +class RouteFilterRuleListResult(msrest.serialization.Model): + """Response for the ListRouteFilterRules API service call. + + :param value: A list of RouteFilterRules in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RouteFilterRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RouteFilterRule"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RouteFilterRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RouteListResult(msrest.serialization.Model): + """Response for the ListRoute API service call. + + :param value: A list of routes in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Route] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Route]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Route"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :param disable_bgp_route_propagation: Whether to disable the routes learned by BGP on that + route table. True means disable. + :type disable_bgp_route_propagation: bool + :ivar provisioning_state: The provisioning state of the route table resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnets': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'disable_bgp_route_propagation': {'key': 'properties.disableBgpRoutePropagation', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + routes: Optional[List["Route"]] = None, + disable_bgp_route_propagation: Optional[bool] = None, + **kwargs + ): + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.routes = routes + self.subnets = None + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.provisioning_state = None + + +class RouteTableListResult(msrest.serialization.Model): + """Response for the ListRouteTable API service call. + + :param value: A list of route tables in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.RouteTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RouteTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RouteTable"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RouteTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RoutingConfiguration(msrest.serialization.Model): + """Routing Configuration indicating the associated and propagated route tables for this connection. + + :param associated_route_table: The resource id RouteTable associated with this + RoutingConfiguration. + :type associated_route_table: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param propagated_route_tables: The list of RouteTables to advertise the routes to. + :type propagated_route_tables: ~azure.mgmt.network.v2020_07_01.models.PropagatedRouteTable + :param vnet_routes: List of routes that control routing from VirtualHub into a virtual network + connection. + :type vnet_routes: ~azure.mgmt.network.v2020_07_01.models.VnetRoute + """ + + _attribute_map = { + 'associated_route_table': {'key': 'associatedRouteTable', 'type': 'SubResource'}, + 'propagated_route_tables': {'key': 'propagatedRouteTables', 'type': 'PropagatedRouteTable'}, + 'vnet_routes': {'key': 'vnetRoutes', 'type': 'VnetRoute'}, + } + + def __init__( + self, + *, + associated_route_table: Optional["SubResource"] = None, + propagated_route_tables: Optional["PropagatedRouteTable"] = None, + vnet_routes: Optional["VnetRoute"] = None, + **kwargs + ): + super(RoutingConfiguration, self).__init__(**kwargs) + self.associated_route_table = associated_route_table + self.propagated_route_tables = propagated_route_tables + self.vnet_routes = vnet_routes + + +class SecurityGroupNetworkInterface(msrest.serialization.Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: All security rules associated with the network interface. + :type security_rule_associations: + ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + security_rule_associations: Optional["SecurityRuleAssociations"] = None, + **kwargs + ): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations + + +class SecurityGroupViewParameters(msrest.serialization.Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + target_resource_id: str, + **kwargs + ): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + + +class SecurityGroupViewResult(msrest.serialization.Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2020_07_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__( + self, + *, + network_interfaces: Optional[List["SecurityGroupNetworkInterface"]] = None, + **kwargs + ): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class SecurityPartnerProvider(Resource): + """Security Partner Provider resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar provisioning_state: The provisioning state of the Security Partner Provider resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param security_provider_name: The security provider name. Possible values include: "ZScaler", + "IBoss", "Checkpoint". + :type security_provider_name: str or + ~azure.mgmt.network.v2020_07_01.models.SecurityProviderName + :ivar connection_status: The connection status with the Security Partner Provider. Possible + values include: "Unknown", "PartiallyConnected", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProviderConnectionStatus + :param virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'security_provider_name': {'key': 'properties.securityProviderName', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + security_provider_name: Optional[Union[str, "SecurityProviderName"]] = None, + virtual_hub: Optional["SubResource"] = None, + **kwargs + ): + super(SecurityPartnerProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.provisioning_state = None + self.security_provider_name = security_provider_name + self.connection_status = None + self.virtual_hub = virtual_hub + + +class SecurityPartnerProviderListResult(msrest.serialization.Model): + """Response for ListSecurityPartnerProviders API service call. + + :param value: List of Security Partner Providers in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityPartnerProvider]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SecurityPartnerProvider"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SecurityPartnerProviderListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SecurityRule(SubResource): + """Network security rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Network protocol this rule applies to. Possible values include: "Tcp", "Udp", + "Icmp", "Esp", "*", "Ah". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range between 0 and 65535. + Asterisk '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or range between 0 and + 65535. Asterisk '*' can also be used to match all ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterisk '*' can also be used to + match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' + can also be used. If this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or destination IP + range. Asterisk '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. CIDR or destination IP + ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security group specified as + destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: The network traffic is allowed or denied. Possible values include: "Allow", + "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 and 4096. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. + :type priority: int + :param direction: The direction of the rule. The direction specifies if rule will be evaluated + on incoming or outgoing traffic. Possible values include: "Inbound", "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.SecurityRuleDirection + :ivar provisioning_state: The provisioning state of the security rule resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + description: Optional[str] = None, + protocol: Optional[Union[str, "SecurityRuleProtocol"]] = None, + source_port_range: Optional[str] = None, + destination_port_range: Optional[str] = None, + source_address_prefix: Optional[str] = None, + source_address_prefixes: Optional[List[str]] = None, + source_application_security_groups: Optional[List["ApplicationSecurityGroup"]] = None, + destination_address_prefix: Optional[str] = None, + destination_address_prefixes: Optional[List[str]] = None, + destination_application_security_groups: Optional[List["ApplicationSecurityGroup"]] = None, + source_port_ranges: Optional[List[str]] = None, + destination_port_ranges: Optional[List[str]] = None, + access: Optional[Union[str, "SecurityRuleAccess"]] = None, + priority: Optional[int] = None, + direction: Optional[Union[str, "SecurityRuleDirection"]] = None, + **kwargs + ): + super(SecurityRule, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.source_application_security_groups = source_application_security_groups + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.destination_application_security_groups = destination_application_security_groups + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = None + + +class SecurityRuleAssociations(msrest.serialization.Model): + """All security rules associated with the network interface. + + :param network_interface_association: Network interface and it's custom security rules. + :type network_interface_association: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceAssociation + :param subnet_association: Subnet and it's custom security rules. + :type subnet_association: ~azure.mgmt.network.v2020_07_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the network security + group. + :type default_security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__( + self, + *, + network_interface_association: Optional["NetworkInterfaceAssociation"] = None, + subnet_association: Optional["SubnetAssociation"] = None, + default_security_rules: Optional[List["SecurityRule"]] = None, + effective_security_rules: Optional[List["EffectiveNetworkSecurityRule"]] = None, + **kwargs + ): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules + + +class SecurityRuleListResult(msrest.serialization.Model): + """Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group. + + :param value: The security rules in a network security group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SecurityRule"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SecurityRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ServiceAssociationLink(SubResource): + """ServiceAssociationLink resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the resource that is unique within a resource group. This name can be used + to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource. + :type link: str + :ivar provisioning_state: The provisioning state of the service association link resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param allow_delete: If true, the resource can be deleted. + :type allow_delete: bool + :param locations: A list of locations. + :type locations: list[str] + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'allow_delete': {'key': 'properties.allowDelete', 'type': 'bool'}, + 'locations': {'key': 'properties.locations', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + linked_resource_type: Optional[str] = None, + link: Optional[str] = None, + allow_delete: Optional[bool] = None, + locations: Optional[List[str]] = None, + **kwargs + ): + super(ServiceAssociationLink, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.allow_delete = allow_delete + self.locations = locations + + +class ServiceAssociationLinksListResult(msrest.serialization.Model): + """Response for ServiceAssociationLinks_List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The service association links in a subnet. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ServiceAssociationLink] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceAssociationLink]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ServiceAssociationLink"]] = None, + **kwargs + ): + super(ServiceAssociationLinksListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ServiceEndpointPolicy(Resource): + """Service End point policy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param service_endpoint_policy_definitions: A collection of service endpoint policy definitions + of the service endpoint policy. + :type service_endpoint_policy_definitions: + list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :ivar resource_guid: The resource GUID property of the service endpoint policy resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the service endpoint policy resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'subnets': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'service_endpoint_policy_definitions': {'key': 'properties.serviceEndpointPolicyDefinitions', 'type': '[ServiceEndpointPolicyDefinition]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + service_endpoint_policy_definitions: Optional[List["ServiceEndpointPolicyDefinition"]] = None, + **kwargs + ): + super(ServiceEndpointPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.service_endpoint_policy_definitions = service_endpoint_policy_definitions + self.subnets = None + self.resource_guid = None + self.provisioning_state = None + + +class ServiceEndpointPolicyDefinition(SubResource): + """Service Endpoint policy definitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param service: Service endpoint name. + :type service: str + :param service_resources: A list of service resources. + :type service_resources: list[str] + :ivar provisioning_state: The provisioning state of the service endpoint policy definition + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'service': {'key': 'properties.service', 'type': 'str'}, + 'service_resources': {'key': 'properties.serviceResources', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + description: Optional[str] = None, + service: Optional[str] = None, + service_resources: Optional[List[str]] = None, + **kwargs + ): + super(ServiceEndpointPolicyDefinition, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.description = description + self.service = service + self.service_resources = service_resources + self.provisioning_state = None + + +class ServiceEndpointPolicyDefinitionListResult(msrest.serialization.Model): + """Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy. + + :param value: The service endpoint policy definition in a service endpoint policy. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceEndpointPolicyDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ServiceEndpointPolicyDefinition"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ServiceEndpointPolicyDefinitionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ServiceEndpointPolicyListResult(msrest.serialization.Model): + """Response for ListServiceEndpointPolicies API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of ServiceEndpointPolicy resources. + :type value: list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceEndpointPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ServiceEndpointPolicy"]] = None, + **kwargs + ): + super(ServiceEndpointPolicyListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ServiceEndpointPropertiesFormat(msrest.serialization.Model): + """The service endpoint properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :ivar provisioning_state: The provisioning state of the service endpoint resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + service: Optional[str] = None, + locations: Optional[List[str]] = None, + **kwargs + ): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = None + + +class ServiceTagInformation(msrest.serialization.Model): + """The service tag information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar properties: Properties of the service tag information. + :vartype properties: + ~azure.mgmt.network.v2020_07_01.models.ServiceTagInformationPropertiesFormat + :ivar name: The name of service tag. + :vartype name: str + :ivar id: The ID of service tag. + :vartype id: str + """ + + _validation = { + 'properties': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ServiceTagInformationPropertiesFormat'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceTagInformation, self).__init__(**kwargs) + self.properties = None + self.name = None + self.id = None + + +class ServiceTagInformationPropertiesFormat(msrest.serialization.Model): + """Properties of the service tag information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar change_number: The iteration number of service tag. + :vartype change_number: str + :ivar region: The region of service tag. + :vartype region: str + :ivar system_service: The name of system service. + :vartype system_service: str + :ivar address_prefixes: The list of IP address prefixes. + :vartype address_prefixes: list[str] + """ + + _validation = { + 'change_number': {'readonly': True}, + 'region': {'readonly': True}, + 'system_service': {'readonly': True}, + 'address_prefixes': {'readonly': True}, + } + + _attribute_map = { + 'change_number': {'key': 'changeNumber', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'system_service': {'key': 'systemService', 'type': 'str'}, + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceTagInformationPropertiesFormat, self).__init__(**kwargs) + self.change_number = None + self.region = None + self.system_service = None + self.address_prefixes = None + + +class ServiceTagsListResult(msrest.serialization.Model): + """Response for the ListServiceTags API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the cloud. + :vartype name: str + :ivar id: The ID of the cloud. + :vartype id: str + :ivar type: The azure resource type. + :vartype type: str + :ivar change_number: The iteration number. + :vartype change_number: str + :ivar cloud: The name of the cloud. + :vartype cloud: str + :ivar values: The list of service tag information resources. + :vartype values: list[~azure.mgmt.network.v2020_07_01.models.ServiceTagInformation] + :ivar next_link: The URL to get next page of service tag information resources. + :vartype next_link: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'change_number': {'readonly': True}, + 'cloud': {'readonly': True}, + 'values': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'change_number': {'key': 'changeNumber', 'type': 'str'}, + 'cloud': {'key': 'cloud', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[ServiceTagInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceTagsListResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.change_number = None + self.cloud = None + self.values = None + self.next_link = None + + +class SessionIds(msrest.serialization.Model): + """List of session IDs. + + :param session_ids: List of session IDs. + :type session_ids: list[str] + """ + + _attribute_map = { + 'session_ids': {'key': 'sessionIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + session_ids: Optional[List[str]] = None, + **kwargs + ): + super(SessionIds, self).__init__(**kwargs) + self.session_ids = session_ids + + +class StaticRoute(msrest.serialization.Model): + """List of all Static Routes. + + :param name: The name of the StaticRoute that is unique within a VnetRoute. + :type name: str + :param address_prefixes: List of all address prefixes. + :type address_prefixes: list[str] + :param next_hop_ip_address: The ip address of the next hop. + :type next_hop_ip_address: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + address_prefixes: Optional[List[str]] = None, + next_hop_ip_address: Optional[str] = None, + **kwargs + ): + super(StaticRoute, self).__init__(**kwargs) + self.name = name + self.address_prefixes = address_prefixes + self.next_hop_ip_address = next_hop_ip_address + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param address_prefixes: List of address prefixes for the subnet. + :type address_prefixes: list[str] + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :param route_table: The reference to the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint] + :ivar ip_configurations: An array of references to the network interface IP configurations + using subnet. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.IPConfiguration] + :ivar ip_configuration_profiles: Array of IP configuration profiles which reference this + subnet. + :vartype ip_configuration_profiles: + list[~azure.mgmt.network.v2020_07_01.models.IPConfigurationProfile] + :param ip_allocations: Array of IpAllocation which reference this subnet. + :type ip_allocations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar resource_navigation_links: An array of references to the external resources using subnet. + :vartype resource_navigation_links: + list[~azure.mgmt.network.v2020_07_01.models.ResourceNavigationLink] + :ivar service_association_links: An array of references to services injecting into this subnet. + :vartype service_association_links: + list[~azure.mgmt.network.v2020_07_01.models.ServiceAssociationLink] + :param delegations: An array of references to the delegations on the subnet. + :type delegations: list[~azure.mgmt.network.v2020_07_01.models.Delegation] + :ivar purpose: A read-only string identifying the intention of use for this subnet based on + delegations and other user-defined properties. + :vartype purpose: str + :ivar provisioning_state: The provisioning state of the subnet resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param private_endpoint_network_policies: Enable or Disable apply network policies on private + end point in the subnet. + :type private_endpoint_network_policies: str + :param private_link_service_network_policies: Enable or Disable apply network policies on + private link service in the subnet. + :type private_link_service_network_policies: str + """ + + _validation = { + 'etag': {'readonly': True}, + 'private_endpoints': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + 'ip_configuration_profiles': {'readonly': True}, + 'resource_navigation_links': {'readonly': True}, + 'service_association_links': {'readonly': True}, + 'purpose': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'address_prefixes': {'key': 'properties.addressPrefixes', 'type': '[str]'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'nat_gateway': {'key': 'properties.natGateway', 'type': 'SubResource'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'service_endpoint_policies': {'key': 'properties.serviceEndpointPolicies', 'type': '[ServiceEndpointPolicy]'}, + 'private_endpoints': {'key': 'properties.privateEndpoints', 'type': '[PrivateEndpoint]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'ip_configuration_profiles': {'key': 'properties.ipConfigurationProfiles', 'type': '[IPConfigurationProfile]'}, + 'ip_allocations': {'key': 'properties.ipAllocations', 'type': '[SubResource]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'service_association_links': {'key': 'properties.serviceAssociationLinks', 'type': '[ServiceAssociationLink]'}, + 'delegations': {'key': 'properties.delegations', 'type': '[Delegation]'}, + 'purpose': {'key': 'properties.purpose', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_network_policies': {'key': 'properties.privateEndpointNetworkPolicies', 'type': 'str'}, + 'private_link_service_network_policies': {'key': 'properties.privateLinkServiceNetworkPolicies', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + address_prefix: Optional[str] = None, + address_prefixes: Optional[List[str]] = None, + network_security_group: Optional["NetworkSecurityGroup"] = None, + route_table: Optional["RouteTable"] = None, + nat_gateway: Optional["SubResource"] = None, + service_endpoints: Optional[List["ServiceEndpointPropertiesFormat"]] = None, + service_endpoint_policies: Optional[List["ServiceEndpointPolicy"]] = None, + ip_allocations: Optional[List["SubResource"]] = None, + delegations: Optional[List["Delegation"]] = None, + private_endpoint_network_policies: Optional[str] = None, + private_link_service_network_policies: Optional[str] = None, + **kwargs + ): + super(Subnet, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.address_prefix = address_prefix + self.address_prefixes = address_prefixes + self.network_security_group = network_security_group + self.route_table = route_table + self.nat_gateway = nat_gateway + self.service_endpoints = service_endpoints + self.service_endpoint_policies = service_endpoint_policies + self.private_endpoints = None + self.ip_configurations = None + self.ip_configuration_profiles = None + self.ip_allocations = ip_allocations + self.resource_navigation_links = None + self.service_association_links = None + self.delegations = delegations + self.purpose = None + self.provisioning_state = None + self.private_endpoint_network_policies = private_endpoint_network_policies + self.private_link_service_network_policies = private_link_service_network_policies + + +class SubnetAssociation(msrest.serialization.Model): + """Subnet and it's custom security rules. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: list[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__( + self, + *, + security_rules: Optional[List["SecurityRule"]] = None, + **kwargs + ): + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules + + +class SubnetListResult(msrest.serialization.Model): + """Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. + + :param value: The subnets in a virtual network. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Subnet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Subnet"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SubnetListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = tags + + +class Topology(msrest.serialization.Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially created for the resource + group. + :vartype created_date_time: ~datetime.datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: ~datetime.datetime + :param resources: A list of topology resources. + :type resources: list[~azure.mgmt.network.v2020_07_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__( + self, + *, + resources: Optional[List["TopologyResource"]] = None, + **kwargs + ): + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources + + +class TopologyAssociation(msrest.serialization.Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the parent resource. + Possible values include: "Associated", "Contains". + :type association_type: str or ~azure.mgmt.network.v2020_07_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + resource_id: Optional[str] = None, + association_type: Optional[Union[str, "AssociationType"]] = None, + **kwargs + ): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type + + +class TopologyParameters(msrest.serialization.Model): + """Parameters that define the representation of topology. + + :param target_resource_group_name: The name of the target resource group to perform topology + on. + :type target_resource_group_name: str + :param target_virtual_network: The reference to the Virtual Network resource. + :type target_virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param target_subnet: The reference to the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + """ + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + 'target_virtual_network': {'key': 'targetVirtualNetwork', 'type': 'SubResource'}, + 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, + } + + def __init__( + self, + *, + target_resource_group_name: Optional[str] = None, + target_virtual_network: Optional["SubResource"] = None, + target_subnet: Optional["SubResource"] = None, + **kwargs + ): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name + self.target_virtual_network = target_virtual_network + self.target_subnet = target_subnet + + +class TopologyResource(msrest.serialization.Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other resources in the + resource group. + :type associations: list[~azure.mgmt.network.v2020_07_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, + location: Optional[str] = None, + associations: Optional[List["TopologyAssociation"]] = None, + **kwargs + ): + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations + + +class TrafficAnalyticsConfigurationProperties(msrest.serialization.Model): + """Parameters that define the configuration of traffic analytics. + + :param enabled: Flag to enable/disable traffic analytics. + :type enabled: bool + :param workspace_id: The resource guid of the attached workspace. + :type workspace_id: str + :param workspace_region: The location of the attached workspace. + :type workspace_region: str + :param workspace_resource_id: Resource Id of the attached workspace. + :type workspace_resource_id: str + :param traffic_analytics_interval: The interval in minutes which would decide how frequently TA + service should do flow analytics. + :type traffic_analytics_interval: int + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_region': {'key': 'workspaceRegion', 'type': 'str'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'traffic_analytics_interval': {'key': 'trafficAnalyticsInterval', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + workspace_id: Optional[str] = None, + workspace_region: Optional[str] = None, + workspace_resource_id: Optional[str] = None, + traffic_analytics_interval: Optional[int] = None, + **kwargs + ): + super(TrafficAnalyticsConfigurationProperties, self).__init__(**kwargs) + self.enabled = enabled + self.workspace_id = workspace_id + self.workspace_region = workspace_region + self.workspace_resource_id = workspace_resource_id + self.traffic_analytics_interval = traffic_analytics_interval + + +class TrafficAnalyticsProperties(msrest.serialization.Model): + """Parameters that define the configuration of traffic analytics. + + :param network_watcher_flow_analytics_configuration: Parameters that define the configuration + of traffic analytics. + :type network_watcher_flow_analytics_configuration: + ~azure.mgmt.network.v2020_07_01.models.TrafficAnalyticsConfigurationProperties + """ + + _attribute_map = { + 'network_watcher_flow_analytics_configuration': {'key': 'networkWatcherFlowAnalyticsConfiguration', 'type': 'TrafficAnalyticsConfigurationProperties'}, + } + + def __init__( + self, + *, + network_watcher_flow_analytics_configuration: Optional["TrafficAnalyticsConfigurationProperties"] = None, + **kwargs + ): + super(TrafficAnalyticsProperties, self).__init__(**kwargs) + self.network_watcher_flow_analytics_configuration = network_watcher_flow_analytics_configuration + + +class TrafficSelectorPolicy(msrest.serialization.Model): + """An traffic selector policy for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param local_address_ranges: Required. A collection of local address spaces in CIDR format. + :type local_address_ranges: list[str] + :param remote_address_ranges: Required. A collection of remote address spaces in CIDR format. + :type remote_address_ranges: list[str] + """ + + _validation = { + 'local_address_ranges': {'required': True}, + 'remote_address_ranges': {'required': True}, + } + + _attribute_map = { + 'local_address_ranges': {'key': 'localAddressRanges', 'type': '[str]'}, + 'remote_address_ranges': {'key': 'remoteAddressRanges', 'type': '[str]'}, + } + + def __init__( + self, + *, + local_address_ranges: List[str], + remote_address_ranges: List[str], + **kwargs + ): + super(TrafficSelectorPolicy, self).__init__(**kwargs) + self.local_address_ranges = local_address_ranges + self.remote_address_ranges = remote_address_ranges + + +class TroubleshootingDetails(msrest.serialization.Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2020_07_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + reason_type: Optional[str] = None, + summary: Optional[str] = None, + detail: Optional[str] = None, + recommended_actions: Optional[List["TroubleshootingRecommendedActions"]] = None, + **kwargs + ): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions + + +class TroubleshootingParameters(msrest.serialization.Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__( + self, + *, + target_resource_id: str, + storage_id: str, + storage_path: str, + **kwargs + ): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path + + +class TroubleshootingRecommendedActions(msrest.serialization.Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended troubleshooting + actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended troubleshooting + actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__( + self, + *, + action_id: Optional[str] = None, + action_text: Optional[str] = None, + action_uri: Optional[str] = None, + action_uri_text: Optional[str] = None, + **kwargs + ): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text + + +class TroubleshootingResult(msrest.serialization.Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: ~datetime.datetime + :param end_time: The end time of the troubleshooting. + :type end_time: ~datetime.datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: list[~azure.mgmt.network.v2020_07_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + code: Optional[str] = None, + results: Optional[List["TroubleshootingDetails"]] = None, + **kwargs + ): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results + + +class TunnelConnectionHealth(msrest.serialization.Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual Network Gateway connection status. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this connection. + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this connection. + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection was established in Utc + format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None + + +class UnprepareNetworkPoliciesRequest(msrest.serialization.Model): + """Details of UnprepareNetworkPolicies for Subnet. + + :param service_name: The name of the service for which subnet is being unprepared for. + :type service_name: str + """ + + _attribute_map = { + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + *, + service_name: Optional[str] = None, + **kwargs + ): + super(UnprepareNetworkPoliciesRequest, self).__init__(**kwargs) + self.service_name = service_name + + +class Usage(msrest.serialization.Model): + """The network resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :param unit: Required. An enum describing the unit of measurement. Possible values include: + "Count". + :type unit: str or ~azure.mgmt.network.v2020_07_01.models.UsageUnit + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2020_07_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + *, + unit: Union[str, "UsageUnit"], + current_value: int, + limit: int, + name: "UsageName", + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name + + +class UsageName(msrest.serialization.Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class UsagesListResult(msrest.serialization.Model): + """The list usages operation response. + + :param value: The list network resource usages. + :type value: list[~azure.mgmt.network.v2020_07_01.models.Usage] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Usage"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(UsagesListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VerificationIPFlowParameters(msrest.serialization.Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a 5-tuple. Possible + values include: "Inbound", "Outbound". + :type direction: str or ~azure.mgmt.network.v2020_07_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_07_01.models.IpFlowProtocol + :param local_port: Required. The local port. Acceptable values are a single integer in the + range (0-65535). Support for * for the source port, which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a single integer in the + range (0-65535). Support for * for the source port, which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values are valid IPv4 + addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable values are valid IPv4 + addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is + enabled on any of them, then this parameter must be specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + target_resource_id: str, + direction: Union[str, "Direction"], + protocol: Union[str, "IpFlowProtocol"], + local_port: str, + remote_port: str, + local_ip_address: str, + remote_ip_address: str, + target_nic_resource_id: Optional[str] = None, + **kwargs + ): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id + + +class VerificationIPFlowResult(msrest.serialization.Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. Possible values include: + "Allow", "Deny". + :type access: str or ~azure.mgmt.network.v2020_07_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any security rule, it is + not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__( + self, + *, + access: Optional[Union[str, "Access"]] = None, + rule_name: Optional[str] = None, + **kwargs + ): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name + + +class VirtualApplianceNicProperties(msrest.serialization.Model): + """Network Virtual Appliance NIC properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: NIC name. + :vartype name: str + :ivar public_ip_address: Public IP address. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP address. + :vartype private_ip_address: str + """ + + _validation = { + 'name': {'readonly': True}, + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplianceNicProperties, self).__init__(**kwargs) + self.name = None + self.public_ip_address = None + self.private_ip_address = None + + +class VirtualApplianceSite(SubResource): + """Virtual Appliance Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the virtual appliance site. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Site type. + :vartype type: str + :param address_prefix: Address Prefix. + :type address_prefix: str + :param o365_policy: Office 365 Policy. + :type o365_policy: ~azure.mgmt.network.v2020_07_01.models.Office365PolicyProperties + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'o365_policy': {'key': 'properties.o365Policy', 'type': 'Office365PolicyProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + address_prefix: Optional[str] = None, + o365_policy: Optional["Office365PolicyProperties"] = None, + **kwargs + ): + super(VirtualApplianceSite, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.address_prefix = address_prefix + self.o365_policy = o365_policy + self.provisioning_state = None + + +class VirtualApplianceSkuProperties(msrest.serialization.Model): + """Network Virtual Appliance Sku Properties. + + :param vendor: Virtual Appliance Vendor. + :type vendor: str + :param bundled_scale_unit: Virtual Appliance Scale Unit. + :type bundled_scale_unit: str + :param market_place_version: Virtual Appliance Version. + :type market_place_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'bundled_scale_unit': {'key': 'bundledScaleUnit', 'type': 'str'}, + 'market_place_version': {'key': 'marketPlaceVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + vendor: Optional[str] = None, + bundled_scale_unit: Optional[str] = None, + market_place_version: Optional[str] = None, + **kwargs + ): + super(VirtualApplianceSkuProperties, self).__init__(**kwargs) + self.vendor = vendor + self.bundled_scale_unit = bundled_scale_unit + self.market_place_version = market_place_version + + +class VirtualHub(Resource): + """VirtualHub Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_wan: The VirtualWAN to which the VirtualHub belongs. + :type virtual_wan: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param vpn_gateway: The VpnGateway associated with this VirtualHub. + :type vpn_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :type p2_s_vpn_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :type express_route_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param azure_firewall: The azureFirewall associated with this VirtualHub. + :type azure_firewall: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :type security_partner_provider: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param address_prefix: Address-prefix for this VirtualHub. + :type address_prefix: str + :param route_table: The routeTable associated with this virtual hub. + :type route_table: ~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTable + :ivar provisioning_state: The provisioning state of the virtual hub resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param security_provider_name: The Security Provider name. + :type security_provider_name: str + :param virtual_hub_route_table_v2_s: List of all virtual hub route table v2s associated with + this VirtualHub. + :type virtual_hub_route_table_v2_s: + list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2] + :param sku: The sku of this VirtualHub. + :type sku: str + :ivar routing_state: The routing state. Possible values include: "None", "Provisioned", + "Provisioning", "Failed". + :vartype routing_state: str or ~azure.mgmt.network.v2020_07_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param virtual_router_asn: VirtualRouter ASN. + :type virtual_router_asn: long + :param virtual_router_ips: VirtualRouter IPs. + :type virtual_router_ips: list[str] + :param allow_branch_to_branch_traffic: Flag to control transit for VirtualRouter hub. + :type allow_branch_to_branch_traffic: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'routing_state': {'readonly': True}, + 'bgp_connections': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + 'virtual_router_asn': {'maximum': 4294967295, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_wan': {'key': 'properties.virtualWan', 'type': 'SubResource'}, + 'vpn_gateway': {'key': 'properties.vpnGateway', 'type': 'SubResource'}, + 'p2_s_vpn_gateway': {'key': 'properties.p2SVpnGateway', 'type': 'SubResource'}, + 'express_route_gateway': {'key': 'properties.expressRouteGateway', 'type': 'SubResource'}, + 'azure_firewall': {'key': 'properties.azureFirewall', 'type': 'SubResource'}, + 'security_partner_provider': {'key': 'properties.securityPartnerProvider', 'type': 'SubResource'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'VirtualHubRouteTable'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'security_provider_name': {'key': 'properties.securityProviderName', 'type': 'str'}, + 'virtual_hub_route_table_v2_s': {'key': 'properties.virtualHubRouteTableV2s', 'type': '[VirtualHubRouteTableV2]'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'routing_state': {'key': 'properties.routingState', 'type': 'str'}, + 'bgp_connections': {'key': 'properties.bgpConnections', 'type': '[SubResource]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[SubResource]'}, + 'virtual_router_asn': {'key': 'properties.virtualRouterAsn', 'type': 'long'}, + 'virtual_router_ips': {'key': 'properties.virtualRouterIps', 'type': '[str]'}, + 'allow_branch_to_branch_traffic': {'key': 'properties.allowBranchToBranchTraffic', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_wan: Optional["SubResource"] = None, + vpn_gateway: Optional["SubResource"] = None, + p2_s_vpn_gateway: Optional["SubResource"] = None, + express_route_gateway: Optional["SubResource"] = None, + azure_firewall: Optional["SubResource"] = None, + security_partner_provider: Optional["SubResource"] = None, + address_prefix: Optional[str] = None, + route_table: Optional["VirtualHubRouteTable"] = None, + security_provider_name: Optional[str] = None, + virtual_hub_route_table_v2_s: Optional[List["VirtualHubRouteTableV2"]] = None, + sku: Optional[str] = None, + virtual_router_asn: Optional[int] = None, + virtual_router_ips: Optional[List[str]] = None, + allow_branch_to_branch_traffic: Optional[bool] = None, + **kwargs + ): + super(VirtualHub, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_wan = virtual_wan + self.vpn_gateway = vpn_gateway + self.p2_s_vpn_gateway = p2_s_vpn_gateway + self.express_route_gateway = express_route_gateway + self.azure_firewall = azure_firewall + self.security_partner_provider = security_partner_provider + self.address_prefix = address_prefix + self.route_table = route_table + self.provisioning_state = None + self.security_provider_name = security_provider_name + self.virtual_hub_route_table_v2_s = virtual_hub_route_table_v2_s + self.sku = sku + self.routing_state = None + self.bgp_connections = None + self.ip_configurations = None + self.virtual_router_asn = virtual_router_asn + self.virtual_router_ips = virtual_router_ips + self.allow_branch_to_branch_traffic = allow_branch_to_branch_traffic + + +class VirtualHubEffectiveRoute(msrest.serialization.Model): + """The effective route configured on the virtual hub or specified resource. + + :param address_prefixes: The list of address prefixes. + :type address_prefixes: list[str] + :param next_hops: The list of next hops. + :type next_hops: list[str] + :param next_hop_type: The type of the next hop. + :type next_hop_type: str + :param as_path: The ASPath of this route. + :type as_path: str + :param route_origin: The origin of this route. + :type route_origin: str + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'next_hops': {'key': 'nextHops', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'route_origin': {'key': 'routeOrigin', 'type': 'str'}, + } + + def __init__( + self, + *, + address_prefixes: Optional[List[str]] = None, + next_hops: Optional[List[str]] = None, + next_hop_type: Optional[str] = None, + as_path: Optional[str] = None, + route_origin: Optional[str] = None, + **kwargs + ): + super(VirtualHubEffectiveRoute, self).__init__(**kwargs) + self.address_prefixes = address_prefixes + self.next_hops = next_hops + self.next_hop_type = next_hop_type + self.as_path = as_path + self.route_origin = route_origin + + +class VirtualHubEffectiveRouteList(msrest.serialization.Model): + """EffectiveRoutes List. + + :param value: The list of effective routes configured on the virtual hub or the specified + resource. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubEffectiveRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualHubEffectiveRoute]'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualHubEffectiveRoute"]] = None, + **kwargs + ): + super(VirtualHubEffectiveRouteList, self).__init__(**kwargs) + self.value = value + + +class VirtualHubId(msrest.serialization.Model): + """Virtual Hub identifier. + + :param id: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be + deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same + subscription. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(VirtualHubId, self).__init__(**kwargs) + self.id = id + + +class VirtualHubRoute(msrest.serialization.Model): + """VirtualHub route. + + :param address_prefixes: List of all addressPrefixes. + :type address_prefixes: list[str] + :param next_hop_ip_address: NextHop ip address. + :type next_hop_ip_address: str + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + address_prefixes: Optional[List[str]] = None, + next_hop_ip_address: Optional[str] = None, + **kwargs + ): + super(VirtualHubRoute, self).__init__(**kwargs) + self.address_prefixes = address_prefixes + self.next_hop_ip_address = next_hop_ip_address + + +class VirtualHubRouteTable(msrest.serialization.Model): + """VirtualHub route table. + + :param routes: List of all routes. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRoute] + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': '[VirtualHubRoute]'}, + } + + def __init__( + self, + *, + routes: Optional[List["VirtualHubRoute"]] = None, + **kwargs + ): + super(VirtualHubRouteTable, self).__init__(**kwargs) + self.routes = routes + + +class VirtualHubRouteTableV2(SubResource): + """VirtualHubRouteTableV2 Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param routes: List of all routes. + :type routes: list[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteV2] + :param attached_connections: List of all connections attached to this route table v2. + :type attached_connections: list[str] + :ivar provisioning_state: The provisioning state of the virtual hub route table v2 resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VirtualHubRouteV2]'}, + 'attached_connections': {'key': 'properties.attachedConnections', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + routes: Optional[List["VirtualHubRouteV2"]] = None, + attached_connections: Optional[List[str]] = None, + **kwargs + ): + super(VirtualHubRouteTableV2, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.routes = routes + self.attached_connections = attached_connections + self.provisioning_state = None + + +class VirtualHubRouteV2(msrest.serialization.Model): + """VirtualHubRouteTableV2 route. + + :param destination_type: The type of destinations. + :type destination_type: str + :param destinations: List of all destinations. + :type destinations: list[str] + :param next_hop_type: The type of next hops. + :type next_hop_type: str + :param next_hops: NextHops ip address. + :type next_hops: list[str] + """ + + _attribute_map = { + 'destination_type': {'key': 'destinationType', 'type': 'str'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hops': {'key': 'nextHops', 'type': '[str]'}, + } + + def __init__( + self, + *, + destination_type: Optional[str] = None, + destinations: Optional[List[str]] = None, + next_hop_type: Optional[str] = None, + next_hops: Optional[List[str]] = None, + **kwargs + ): + super(VirtualHubRouteV2, self).__init__(**kwargs) + self.destination_type = destination_type + self.destinations = destinations + self.next_hop_type = next_hop_type + self.next_hops = next_hops + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: The extended location of the virtual network. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param address_space: The AddressSpace that contains an array of IP address ranges that can be + used by subnets. + :type address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers available to VMs + deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2020_07_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2020_07_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering] + :ivar resource_guid: The resourceGuid property of the Virtual Network resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param enable_ddos_protection: Indicates if DDoS protection is enabled for all the protected + resources in the virtual network. It requires a DDoS protection plan associated with the + resource. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if VM protection is enabled for all the subnets in the + virtual network. + :type enable_vm_protection: bool + :param ddos_protection_plan: The DDoS protection plan associated with the virtual network. + :type ddos_protection_plan: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param bgp_communities: Bgp Communities sent over ExpressRoute with each route corresponding to + a prefix in this VNET. + :type bgp_communities: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkBgpCommunities + :param ip_allocations: Array of IpAllocation which reference this VNET. + :type ip_allocations: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'ddos_protection_plan': {'key': 'properties.ddosProtectionPlan', 'type': 'SubResource'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': 'VirtualNetworkBgpCommunities'}, + 'ip_allocations': {'key': 'properties.ipAllocations', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + address_space: Optional["AddressSpace"] = None, + dhcp_options: Optional["DhcpOptions"] = None, + subnets: Optional[List["Subnet"]] = None, + virtual_network_peerings: Optional[List["VirtualNetworkPeering"]] = None, + enable_ddos_protection: Optional[bool] = False, + enable_vm_protection: Optional[bool] = False, + ddos_protection_plan: Optional["SubResource"] = None, + bgp_communities: Optional["VirtualNetworkBgpCommunities"] = None, + ip_allocations: Optional[List["SubResource"]] = None, + **kwargs + ): + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.etag = None + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = None + self.provisioning_state = None + self.enable_ddos_protection = enable_ddos_protection + self.enable_vm_protection = enable_vm_protection + self.ddos_protection_plan = ddos_protection_plan + self.bgp_communities = bgp_communities + self.ip_allocations = ip_allocations + + +class VirtualNetworkBgpCommunities(msrest.serialization.Model): + """Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_community: Required. The BGP community associated with the virtual + network. + :type virtual_network_community: str + :ivar regional_community: The BGP community associated with the region of the virtual network. + :vartype regional_community: str + """ + + _validation = { + 'virtual_network_community': {'required': True}, + 'regional_community': {'readonly': True}, + } + + _attribute_map = { + 'virtual_network_community': {'key': 'virtualNetworkCommunity', 'type': 'str'}, + 'regional_community': {'key': 'regionalCommunity', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_network_community: str, + **kwargs + ): + super(VirtualNetworkBgpCommunities, self).__init__(**kwargs) + self.virtual_network_community = virtual_network_community + self.regional_community = None + + +class VirtualNetworkConnectionGatewayReference(msrest.serialization.Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + **kwargs + ): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible values include: "Vpn", + "ExpressRoute", "LocalGateway". + :type gateway_type: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values include: + "PolicyBased", "RouteBased". + :type vpn_type: str or ~azure.mgmt.network.v2020_07_01.models.VpnType + :param vpn_gateway_generation: The generation for this VirtualNetworkGateway. Must be None if + gatewayType is not VPN. Possible values include: "None", "Generation1", "Generation2". + :type vpn_gateway_generation: str or + ~azure.mgmt.network.v2020_07_01.models.VpnGatewayGeneration + :param enable_bgp: Whether BGP is enabled for this virtual network gateway or not. + :type enable_bgp: bool + :param enable_private_ip_address: Whether private IP needs to be enabled on this gateway for + connections or not. + :type enable_private_ip_address: bool + :param active: ActiveActive flag. + :type active: bool + :param gateway_default_site: The reference to the LocalNetworkGateway resource which represents + local network site having default routes. Assign Null value in case of removing existing + default site setting. + :type gateway_default_site: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param sku: The reference to the VirtualNetworkGatewaySku resource which represents the SKU + selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference to the VpnClientConfiguration resource which + represents the P2S VpnClient configurations. + :type vpn_client_configuration: ~azure.mgmt.network.v2020_07_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :param custom_routes: The reference to the address space resource which represents the custom + routes address space specified by the customer for virtual network gateway and VpnClient. + :type custom_routes: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :ivar resource_guid: The resource GUID property of the virtual network gateway resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param enable_dns_forwarding: Whether dns forwarding is enabled or not. + :type enable_dns_forwarding: bool + :ivar inbound_dns_forwarding_endpoint: The IP address allocated by the gateway to which dns + requests can be sent. + :vartype inbound_dns_forwarding_endpoint: str + :param virtual_network_extended_location_resource_id: MAS FIJI customer vnet resource id. + VirtualNetworkGateway of type local gateway is associated with the customer vnet. + :type virtual_network_extended_location_resource_id: str + :param extended_location: The extended location of type local virtual network gateway. + :type extended_location: ~azure.mgmt.network.v2020_07_01.models.ExtendedLocation + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'inbound_dns_forwarding_endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'vpn_gateway_generation': {'key': 'properties.vpnGatewayGeneration', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'enable_private_ip_address': {'key': 'properties.enablePrivateIpAddress', 'type': 'bool'}, + 'active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'custom_routes': {'key': 'properties.customRoutes', 'type': 'AddressSpace'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_dns_forwarding': {'key': 'properties.enableDnsForwarding', 'type': 'bool'}, + 'inbound_dns_forwarding_endpoint': {'key': 'properties.inboundDnsForwardingEndpoint', 'type': 'str'}, + 'virtual_network_extended_location_resource_id': {'key': 'properties.virtualNetworkExtendedLocationResourceId', 'type': 'str'}, + 'extended_location': {'key': 'properties.extendedLocation', 'type': 'ExtendedLocation'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + ip_configurations: Optional[List["VirtualNetworkGatewayIPConfiguration"]] = None, + gateway_type: Optional[Union[str, "VirtualNetworkGatewayType"]] = None, + vpn_type: Optional[Union[str, "VpnType"]] = None, + vpn_gateway_generation: Optional[Union[str, "VpnGatewayGeneration"]] = None, + enable_bgp: Optional[bool] = None, + enable_private_ip_address: Optional[bool] = None, + active: Optional[bool] = None, + gateway_default_site: Optional["SubResource"] = None, + sku: Optional["VirtualNetworkGatewaySku"] = None, + vpn_client_configuration: Optional["VpnClientConfiguration"] = None, + bgp_settings: Optional["BgpSettings"] = None, + custom_routes: Optional["AddressSpace"] = None, + enable_dns_forwarding: Optional[bool] = None, + virtual_network_extended_location_resource_id: Optional[str] = None, + extended_location: Optional["ExtendedLocation"] = None, + **kwargs + ): + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.vpn_gateway_generation = vpn_gateway_generation + self.enable_bgp = enable_bgp + self.enable_private_ip_address = enable_private_ip_address + self.active = active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.custom_routes = custom_routes + self.resource_guid = None + self.provisioning_state = None + self.enable_dns_forwarding = enable_dns_forwarding + self.inbound_dns_forwarding_endpoint = None + self.virtual_network_extended_location_resource_id = virtual_network_extended_location_resource_id + self.extended_location = extended_location + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. + :type virtual_network_gateway1: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values include: "IPsec", + "Vnet2Vnet", "ExpressRoute", "VPNClient". + :type connection_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionType + :param connection_protocol: Connection protocol used for this connection. Possible values + include: "IKEv2", "IKEv1". + :type connection_protocol: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :param dpd_timeout_seconds: The dead peer detection timeout of this connection in seconds. + :type dpd_timeout_seconds: int + :param connection_mode: The connection mode for this connection. Possible values include: + "Default", "ResponderOnly", "InitiatorOnly". + :type connection_mode: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionMode + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual Network Gateway connection status. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_07_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_local_azure_ip_address: Use private local Azure IP for the connection. + :type use_local_azure_ip_address: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :type traffic_selector_policies: + list[~azure.mgmt.network.v2020_07_01.models.TrafficSelectorPolicy] + :ivar resource_guid: The resource GUID property of the virtual network gateway connection + resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :type express_route_gateway_bypass: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'connection_protocol': {'key': 'properties.connectionProtocol', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'dpd_timeout_seconds': {'key': 'properties.dpdTimeoutSeconds', 'type': 'int'}, + 'connection_mode': {'key': 'properties.connectionMode', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_local_azure_ip_address': {'key': 'properties.useLocalAzureIpAddress', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'traffic_selector_policies': {'key': 'properties.trafficSelectorPolicies', 'type': '[TrafficSelectorPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_gateway_bypass': {'key': 'properties.expressRouteGatewayBypass', 'type': 'bool'}, + } + + def __init__( + self, + *, + virtual_network_gateway1: "VirtualNetworkGateway", + connection_type: Union[str, "VirtualNetworkGatewayConnectionType"], + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + authorization_key: Optional[str] = None, + virtual_network_gateway2: Optional["VirtualNetworkGateway"] = None, + local_network_gateway2: Optional["LocalNetworkGateway"] = None, + connection_protocol: Optional[Union[str, "VirtualNetworkGatewayConnectionProtocol"]] = None, + routing_weight: Optional[int] = None, + dpd_timeout_seconds: Optional[int] = None, + connection_mode: Optional[Union[str, "VirtualNetworkGatewayConnectionMode"]] = None, + shared_key: Optional[str] = None, + peer: Optional["SubResource"] = None, + enable_bgp: Optional[bool] = None, + use_local_azure_ip_address: Optional[bool] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["IpsecPolicy"]] = None, + traffic_selector_policies: Optional[List["TrafficSelectorPolicy"]] = None, + express_route_gateway_bypass: Optional[bool] = None, + **kwargs + ): + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.connection_protocol = connection_protocol + self.routing_weight = routing_weight + self.dpd_timeout_seconds = dpd_timeout_seconds + self.connection_mode = connection_mode + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_local_azure_ip_address = use_local_azure_ip_address + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.traffic_selector_policies = traffic_selector_policies + self.resource_guid = None + self.provisioning_state = None + self.express_route_gateway_bypass = express_route_gateway_bypass + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values include: "IPsec", + "Vnet2Vnet", "ExpressRoute", "VPNClient". + :type connection_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionType + :param connection_protocol: Connection protocol used for this connection. Possible values + include: "IKEv2", "IKEv1". + :type connection_protocol: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :param connection_mode: The connection mode for this connection. Possible values include: + "Default", "ResponderOnly", "InitiatorOnly". + :type connection_mode: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionMode + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual Network Gateway connection status. Possible values include: + "Unknown", "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_07_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param traffic_selector_policies: The Traffic Selector Policies to be considered by this + connection. + :type traffic_selector_policies: + list[~azure.mgmt.network.v2020_07_01.models.TrafficSelectorPolicy] + :ivar resource_guid: The resource GUID property of the virtual network gateway connection + resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network gateway connection + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param express_route_gateway_bypass: Bypass ExpressRoute Gateway for data forwarding. + :type express_route_gateway_bypass: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'connection_protocol': {'key': 'properties.connectionProtocol', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'connection_mode': {'key': 'properties.connectionMode', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'traffic_selector_policies': {'key': 'properties.trafficSelectorPolicies', 'type': '[TrafficSelectorPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_gateway_bypass': {'key': 'properties.expressRouteGatewayBypass', 'type': 'bool'}, + } + + def __init__( + self, + *, + virtual_network_gateway1: "VirtualNetworkConnectionGatewayReference", + connection_type: Union[str, "VirtualNetworkGatewayConnectionType"], + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + authorization_key: Optional[str] = None, + virtual_network_gateway2: Optional["VirtualNetworkConnectionGatewayReference"] = None, + local_network_gateway2: Optional["VirtualNetworkConnectionGatewayReference"] = None, + connection_protocol: Optional[Union[str, "VirtualNetworkGatewayConnectionProtocol"]] = None, + routing_weight: Optional[int] = None, + connection_mode: Optional[Union[str, "VirtualNetworkGatewayConnectionMode"]] = None, + shared_key: Optional[str] = None, + peer: Optional["SubResource"] = None, + enable_bgp: Optional[bool] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["IpsecPolicy"]] = None, + traffic_selector_policies: Optional[List["TrafficSelectorPolicy"]] = None, + express_route_gateway_bypass: Optional[bool] = None, + **kwargs + ): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.connection_protocol = connection_protocol + self.routing_weight = routing_weight + self.connection_mode = connection_mode + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.traffic_selector_policies = traffic_selector_policies + self.resource_guid = None + self.provisioning_state = None + self.express_route_gateway_bypass = express_route_gateway_bypass + + +class VirtualNetworkGatewayConnectionListResult(msrest.serialization.Model): + """Response for the ListVirtualNetworkGatewayConnections API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkGatewayConnection"]] = None, + **kwargs + ): + super(VirtualNetworkGatewayConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param private_ip_allocation_method: The private IP address allocation method. Possible values + include: "Static", "Dynamic". + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2020_07_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar private_ip_address: Private IP Address for this gateway. + :vartype private_ip_address: str + :ivar provisioning_state: The provisioning state of the virtual network gateway IP + configuration resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, + subnet: Optional["SubResource"] = None, + public_ip_address: Optional["SubResource"] = None, + **kwargs + ): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.private_ip_address = None + self.provisioning_state = None + + +class VirtualNetworkGatewayListConnectionsResult(msrest.serialization.Model): + """Response for the VirtualNetworkGatewayListConnections API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of VirtualNetworkGatewayConnection resources that exists in a resource + group. + :type value: + list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionListEntity] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnectionListEntity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkGatewayConnectionListEntity"]] = None, + **kwargs + ): + super(VirtualNetworkGatewayListConnectionsResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkGatewayListResult(msrest.serialization.Model): + """Response for the ListVirtualNetworkGateways API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: A list of VirtualNetworkGateway resources that exists in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkGateway]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkGateway"]] = None, + **kwargs + ): + super(VirtualNetworkGatewayListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class VirtualNetworkGatewaySku(msrest.serialization.Model): + """VirtualNetworkGatewaySku details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Gateway SKU name. Possible values include: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ". + :type name: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: "Basic", "HighPerformance", "Standard", + "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3", "VpnGw4", "VpnGw5", "VpnGw1AZ", "VpnGw2AZ", + "VpnGw3AZ", "VpnGw4AZ", "VpnGw5AZ", "ErGw1AZ", "ErGw2AZ", "ErGw3AZ". + :type tier: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewaySkuTier + :ivar capacity: The capacity. + :vartype capacity: int + """ + + _validation = { + 'capacity': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "VirtualNetworkGatewaySkuName"]] = None, + tier: Optional[Union[str, "VirtualNetworkGatewaySkuTier"]] = None, + **kwargs + ): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = None + + +class VirtualNetworkListResult(msrest.serialization.Model): + """Response for the ListVirtualNetworks API service call. + + :param value: A list of VirtualNetwork resources in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetwork] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetwork"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkListUsageResult(msrest.serialization.Model): + """Response for the virtual networks GetUsage API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: VirtualNetwork usage stats. + :vartype value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkUsage] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkUsage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkListUsageResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param allow_virtual_network_access: Whether the VMs in the local virtual network space would + be able to access the VMs in remote virtual network space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs in the local virtual + network will be allowed/disallowed in remote virtual network. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote virtual networking to link + to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual network. If the flag + is set to true, and allowGatewayTransit on remote peering is also true, virtual network will + use gateways of remote virtual network for transit. Only one peering can have this flag set to + true. This flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference to the remote virtual network. The remote virtual + network can be in the same or different region (preview). See here to register for the preview + and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create- + peering). + :type remote_virtual_network: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param remote_address_space: The reference to the remote virtual network address space. + :type remote_address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param remote_bgp_communities: The reference to the remote virtual network's Bgp Communities. + :type remote_bgp_communities: + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkBgpCommunities + :param peering_state: The status of the virtual network peering. Possible values include: + "Initiated", "Connected", "Disconnected". + :type peering_state: str or ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeeringState + :ivar provisioning_state: The provisioning state of the virtual network peering resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'remote_bgp_communities': {'key': 'properties.remoteBgpCommunities', 'type': 'VirtualNetworkBgpCommunities'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + allow_virtual_network_access: Optional[bool] = None, + allow_forwarded_traffic: Optional[bool] = None, + allow_gateway_transit: Optional[bool] = None, + use_remote_gateways: Optional[bool] = None, + remote_virtual_network: Optional["SubResource"] = None, + remote_address_space: Optional["AddressSpace"] = None, + remote_bgp_communities: Optional["VirtualNetworkBgpCommunities"] = None, + peering_state: Optional[Union[str, "VirtualNetworkPeeringState"]] = None, + **kwargs + ): + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.remote_address_space = remote_address_space + self.remote_bgp_communities = remote_bgp_communities + self.peering_state = peering_state + self.provisioning_state = None + + +class VirtualNetworkPeeringListResult(msrest.serialization.Model): + """Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. + + :param value: The peerings in a virtual network. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkPeering"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkPeeringListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkTap(Resource): + """Virtual Network Tap resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar network_interface_tap_configurations: Specifies the list of resource IDs for the network + interface IP configuration that needs to be tapped. + :vartype network_interface_tap_configurations: + list[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :ivar resource_guid: The resource GUID property of the virtual network tap resource. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the virtual network tap resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param destination_network_interface_ip_configuration: The reference to the private IP Address + of the collector nic that will receive the tap. + :type destination_network_interface_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :param destination_load_balancer_front_end_ip_configuration: The reference to the private IP + address on the internal Load Balancer that will receive the tap. + :type destination_load_balancer_front_end_ip_configuration: + ~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration + :param destination_port: The VXLAN destination port that will receive the tapped traffic. + :type destination_port: int + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'network_interface_tap_configurations': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'network_interface_tap_configurations': {'key': 'properties.networkInterfaceTapConfigurations', 'type': '[NetworkInterfaceTapConfiguration]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'destination_network_interface_ip_configuration': {'key': 'properties.destinationNetworkInterfaceIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'destination_load_balancer_front_end_ip_configuration': {'key': 'properties.destinationLoadBalancerFrontEndIPConfiguration', 'type': 'FrontendIPConfiguration'}, + 'destination_port': {'key': 'properties.destinationPort', 'type': 'int'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + destination_network_interface_ip_configuration: Optional["NetworkInterfaceIPConfiguration"] = None, + destination_load_balancer_front_end_ip_configuration: Optional["FrontendIPConfiguration"] = None, + destination_port: Optional[int] = None, + **kwargs + ): + super(VirtualNetworkTap, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.network_interface_tap_configurations = None + self.resource_guid = None + self.provisioning_state = None + self.destination_network_interface_ip_configuration = destination_network_interface_ip_configuration + self.destination_load_balancer_front_end_ip_configuration = destination_load_balancer_front_end_ip_configuration + self.destination_port = destination_port + + +class VirtualNetworkTapListResult(msrest.serialization.Model): + """Response for ListVirtualNetworkTap API service call. + + :param value: A list of VirtualNetworkTaps in a resource group. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualNetworkTap]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualNetworkTap"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkTapListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualNetworkUsage(msrest.serialization.Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count'. + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None + + +class VirtualNetworkUsageName(msrest.serialization.Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None + + +class VirtualRouter(Resource): + """VirtualRouter Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_router_asn: VirtualRouter ASN. + :type virtual_router_asn: long + :param virtual_router_ips: VirtualRouter IPs. + :type virtual_router_ips: list[str] + :param hosted_subnet: The Subnet on which VirtualRouter is hosted. + :type hosted_subnet: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param hosted_gateway: The Gateway on which VirtualRouter is hosted. + :type hosted_gateway: ~azure.mgmt.network.v2020_07_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_router_asn': {'maximum': 4294967295, 'minimum': 0}, + 'peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_router_asn': {'key': 'properties.virtualRouterAsn', 'type': 'long'}, + 'virtual_router_ips': {'key': 'properties.virtualRouterIps', 'type': '[str]'}, + 'hosted_subnet': {'key': 'properties.hostedSubnet', 'type': 'SubResource'}, + 'hosted_gateway': {'key': 'properties.hostedGateway', 'type': 'SubResource'}, + 'peerings': {'key': 'properties.peerings', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_router_asn: Optional[int] = None, + virtual_router_ips: Optional[List[str]] = None, + hosted_subnet: Optional["SubResource"] = None, + hosted_gateway: Optional["SubResource"] = None, + **kwargs + ): + super(VirtualRouter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_router_asn = virtual_router_asn + self.virtual_router_ips = virtual_router_ips + self.hosted_subnet = hosted_subnet + self.hosted_gateway = hosted_gateway + self.peerings = None + self.provisioning_state = None + + +class VirtualRouterListResult(msrest.serialization.Model): + """Response for ListVirtualRouters API service call. + + :param value: List of Virtual Routers. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualRouter] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualRouter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualRouter"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualRouterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualRouterPeering(SubResource): + """Virtual Router Peering resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: Name of the virtual router peering that is unique within a virtual router. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Peering type. + :vartype type: str + :param peer_asn: Peer ASN. + :type peer_asn: long + :param peer_ip: Peer IP. + :type peer_ip: str + :ivar provisioning_state: The provisioning state of the resource. Possible values include: + "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'peer_asn': {'maximum': 4294967295, 'minimum': 0}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peer_asn': {'key': 'properties.peerAsn', 'type': 'long'}, + 'peer_ip': {'key': 'properties.peerIp', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + peer_asn: Optional[int] = None, + peer_ip: Optional[str] = None, + **kwargs + ): + super(VirtualRouterPeering, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.peer_asn = peer_asn + self.peer_ip = peer_ip + self.provisioning_state = None + + +class VirtualRouterPeeringListResult(msrest.serialization.Model): + """Response for ListVirtualRouterPeerings API service call. + + :param value: List of VirtualRouterPeerings in a VirtualRouter. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualRouterPeering]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualRouterPeering"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualRouterPeeringListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualWAN(Resource): + """VirtualWAN Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param disable_vpn_encryption: Vpn encryption to be disabled or not. + :type disable_vpn_encryption: bool + :ivar virtual_hubs: List of VirtualHubs in the VirtualWAN. + :vartype virtual_hubs: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :param allow_branch_to_branch_traffic: True if branch to branch traffic is allowed. + :type allow_branch_to_branch_traffic: bool + :param allow_vnet_to_vnet_traffic: True if Vnet to Vnet traffic is allowed. + :type allow_vnet_to_vnet_traffic: bool + :ivar office365_local_breakout_category: The office local breakout category. Possible values + include: "Optimize", "OptimizeAndAllow", "All", "None". + :vartype office365_local_breakout_category: str or + ~azure.mgmt.network.v2020_07_01.models.OfficeTrafficCategory + :ivar provisioning_state: The provisioning state of the virtual WAN resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param type_properties_type: The type of the VirtualWAN. + :type type_properties_type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_hubs': {'readonly': True}, + 'vpn_sites': {'readonly': True}, + 'office365_local_breakout_category': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'disable_vpn_encryption': {'key': 'properties.disableVpnEncryption', 'type': 'bool'}, + 'virtual_hubs': {'key': 'properties.virtualHubs', 'type': '[SubResource]'}, + 'vpn_sites': {'key': 'properties.vpnSites', 'type': '[SubResource]'}, + 'allow_branch_to_branch_traffic': {'key': 'properties.allowBranchToBranchTraffic', 'type': 'bool'}, + 'allow_vnet_to_vnet_traffic': {'key': 'properties.allowVnetToVnetTraffic', 'type': 'bool'}, + 'office365_local_breakout_category': {'key': 'properties.office365LocalBreakoutCategory', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + disable_vpn_encryption: Optional[bool] = None, + allow_branch_to_branch_traffic: Optional[bool] = None, + allow_vnet_to_vnet_traffic: Optional[bool] = None, + type_properties_type: Optional[str] = None, + **kwargs + ): + super(VirtualWAN, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.disable_vpn_encryption = disable_vpn_encryption + self.virtual_hubs = None + self.vpn_sites = None + self.allow_branch_to_branch_traffic = allow_branch_to_branch_traffic + self.allow_vnet_to_vnet_traffic = allow_vnet_to_vnet_traffic + self.office365_local_breakout_category = None + self.provisioning_state = None + self.type_properties_type = type_properties_type + + +class VirtualWanSecurityProvider(msrest.serialization.Model): + """Collection of SecurityProviders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of the security provider. + :type name: str + :param url: Url of the security provider. + :type url: str + :ivar type: Name of the security provider. Possible values include: "External", "Native". + :vartype type: str or ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviderType + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + url: Optional[str] = None, + **kwargs + ): + super(VirtualWanSecurityProvider, self).__init__(**kwargs) + self.name = name + self.url = url + self.type = None + + +class VirtualWanSecurityProviders(msrest.serialization.Model): + """Collection of SecurityProviders. + + :param supported_providers: List of VirtualWAN security providers. + :type supported_providers: + list[~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProvider] + """ + + _attribute_map = { + 'supported_providers': {'key': 'supportedProviders', 'type': '[VirtualWanSecurityProvider]'}, + } + + def __init__( + self, + *, + supported_providers: Optional[List["VirtualWanSecurityProvider"]] = None, + **kwargs + ): + super(VirtualWanSecurityProviders, self).__init__(**kwargs) + self.supported_providers = supported_providers + + +class VirtualWanVpnProfileParameters(msrest.serialization.Model): + """Virtual Wan Vpn profile parameters Vpn profile generation. + + :param vpn_server_configuration_resource_id: VpnServerConfiguration partial resource uri with + which VirtualWan is associated to. + :type vpn_server_configuration_resource_id: str + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_07_01.models.AuthenticationMethod + """ + + _attribute_map = { + 'vpn_server_configuration_resource_id': {'key': 'vpnServerConfigurationResourceId', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + vpn_server_configuration_resource_id: Optional[str] = None, + authentication_method: Optional[Union[str, "AuthenticationMethod"]] = None, + **kwargs + ): + super(VirtualWanVpnProfileParameters, self).__init__(**kwargs) + self.vpn_server_configuration_resource_id = vpn_server_configuration_resource_id + self.authentication_method = authentication_method + + +class VM(Resource): + """Describes a Virtual Machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(VM, self).__init__(id=id, location=location, tags=tags, **kwargs) + + +class VnetRoute(msrest.serialization.Model): + """List of routes that control routing from VirtualHub into a virtual network connection. + + :param static_routes: List of all Static Routes. + :type static_routes: list[~azure.mgmt.network.v2020_07_01.models.StaticRoute] + """ + + _attribute_map = { + 'static_routes': {'key': 'staticRoutes', 'type': '[StaticRoute]'}, + } + + def __init__( + self, + *, + static_routes: Optional[List["StaticRoute"]] = None, + **kwargs + ): + super(VnetRoute, self).__init__(**kwargs) + self.static_routes = static_routes + + +class VpnClientConfiguration(msrest.serialization.Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference to the address space resource which represents + Address space for P2S VpnClient. + :type vpn_client_address_pool: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.VpnClientProtocol] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for virtual network gateway P2S + client. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param radius_server_address: The radius server address property of the VirtualNetworkGateway + resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the VirtualNetworkGateway resource + for vpn client connection. + :type radius_server_secret: str + :param radius_servers: The radiusServers property for multiple radius server configuration. + :type radius_servers: list[~azure.mgmt.network.v2020_07_01.models.RadiusServer] + :param aad_tenant: The AADTenant property of the VirtualNetworkGateway resource for vpn client + connection used for AAD authentication. + :type aad_tenant: str + :param aad_audience: The AADAudience property of the VirtualNetworkGateway resource for vpn + client connection used for AAD authentication. + :type aad_audience: str + :param aad_issuer: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + connection used for AAD authentication. + :type aad_issuer: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'vpn_client_ipsec_policies': {'key': 'vpnClientIpsecPolicies', 'type': '[IpsecPolicy]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + 'radius_servers': {'key': 'radiusServers', 'type': '[RadiusServer]'}, + 'aad_tenant': {'key': 'aadTenant', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, + 'aad_issuer': {'key': 'aadIssuer', 'type': 'str'}, + } + + def __init__( + self, + *, + vpn_client_address_pool: Optional["AddressSpace"] = None, + vpn_client_root_certificates: Optional[List["VpnClientRootCertificate"]] = None, + vpn_client_revoked_certificates: Optional[List["VpnClientRevokedCertificate"]] = None, + vpn_client_protocols: Optional[List[Union[str, "VpnClientProtocol"]]] = None, + vpn_client_ipsec_policies: Optional[List["IpsecPolicy"]] = None, + radius_server_address: Optional[str] = None, + radius_server_secret: Optional[str] = None, + radius_servers: Optional[List["RadiusServer"]] = None, + aad_tenant: Optional[str] = None, + aad_audience: Optional[str] = None, + aad_issuer: Optional[str] = None, + **kwargs + ): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.vpn_client_ipsec_policies = vpn_client_ipsec_policies + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret + self.radius_servers = radius_servers + self.aad_tenant = aad_tenant + self.aad_audience = aad_audience + self.aad_issuer = aad_issuer + + +class VpnClientConnectionHealth(msrest.serialization.Model): + """VpnClientConnectionHealth properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar total_ingress_bytes_transferred: Total of the Ingress Bytes Transferred in this P2S Vpn + connection. + :vartype total_ingress_bytes_transferred: long + :ivar total_egress_bytes_transferred: Total of the Egress Bytes Transferred in this connection. + :vartype total_egress_bytes_transferred: long + :param vpn_client_connections_count: The total of p2s vpn clients connected at this time to + this P2SVpnGateway. + :type vpn_client_connections_count: int + :param allocated_ip_addresses: List of allocated ip addresses to the connected p2s vpn clients. + :type allocated_ip_addresses: list[str] + """ + + _validation = { + 'total_ingress_bytes_transferred': {'readonly': True}, + 'total_egress_bytes_transferred': {'readonly': True}, + } + + _attribute_map = { + 'total_ingress_bytes_transferred': {'key': 'totalIngressBytesTransferred', 'type': 'long'}, + 'total_egress_bytes_transferred': {'key': 'totalEgressBytesTransferred', 'type': 'long'}, + 'vpn_client_connections_count': {'key': 'vpnClientConnectionsCount', 'type': 'int'}, + 'allocated_ip_addresses': {'key': 'allocatedIpAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + vpn_client_connections_count: Optional[int] = None, + allocated_ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(VpnClientConnectionHealth, self).__init__(**kwargs) + self.total_ingress_bytes_transferred = None + self.total_egress_bytes_transferred = None + self.vpn_client_connections_count = vpn_client_connections_count + self.allocated_ip_addresses = allocated_ip_addresses + + +class VpnClientConnectionHealthDetail(msrest.serialization.Model): + """VPN client connection health detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vpn_connection_id: The vpn client Id. + :vartype vpn_connection_id: str + :ivar vpn_connection_duration: The duration time of a connected vpn client. + :vartype vpn_connection_duration: long + :ivar vpn_connection_time: The start time of a connected vpn client. + :vartype vpn_connection_time: str + :ivar public_ip_address: The public Ip of a connected vpn client. + :vartype public_ip_address: str + :ivar private_ip_address: The assigned private Ip of a connected vpn client. + :vartype private_ip_address: str + :ivar vpn_user_name: The user name of a connected vpn client. + :vartype vpn_user_name: str + :ivar max_bandwidth: The max band width. + :vartype max_bandwidth: long + :ivar egress_packets_transferred: The egress packets per second. + :vartype egress_packets_transferred: long + :ivar egress_bytes_transferred: The egress bytes per second. + :vartype egress_bytes_transferred: long + :ivar ingress_packets_transferred: The ingress packets per second. + :vartype ingress_packets_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes per second. + :vartype ingress_bytes_transferred: long + :ivar max_packets_per_second: The max packets transferred per second. + :vartype max_packets_per_second: long + """ + + _validation = { + 'vpn_connection_id': {'readonly': True}, + 'vpn_connection_duration': {'readonly': True}, + 'vpn_connection_time': {'readonly': True}, + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'vpn_user_name': {'readonly': True}, + 'max_bandwidth': {'readonly': True}, + 'egress_packets_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_packets_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'max_packets_per_second': {'readonly': True}, + } + + _attribute_map = { + 'vpn_connection_id': {'key': 'vpnConnectionId', 'type': 'str'}, + 'vpn_connection_duration': {'key': 'vpnConnectionDuration', 'type': 'long'}, + 'vpn_connection_time': {'key': 'vpnConnectionTime', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'vpn_user_name': {'key': 'vpnUserName', 'type': 'str'}, + 'max_bandwidth': {'key': 'maxBandwidth', 'type': 'long'}, + 'egress_packets_transferred': {'key': 'egressPacketsTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'ingress_packets_transferred': {'key': 'ingressPacketsTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'max_packets_per_second': {'key': 'maxPacketsPerSecond', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnClientConnectionHealthDetail, self).__init__(**kwargs) + self.vpn_connection_id = None + self.vpn_connection_duration = None + self.vpn_connection_time = None + self.public_ip_address = None + self.private_ip_address = None + self.vpn_user_name = None + self.max_bandwidth = None + self.egress_packets_transferred = None + self.egress_bytes_transferred = None + self.ingress_packets_transferred = None + self.ingress_bytes_transferred = None + self.max_packets_per_second = None + + +class VpnClientConnectionHealthDetailListResult(msrest.serialization.Model): + """List of virtual network gateway vpn client connection health. + + :param value: List of vpn client connection health. + :type value: list[~azure.mgmt.network.v2020_07_01.models.VpnClientConnectionHealthDetail] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VpnClientConnectionHealthDetail]'}, + } + + def __init__( + self, + *, + value: Optional[List["VpnClientConnectionHealthDetail"]] = None, + **kwargs + ): + super(VpnClientConnectionHealthDetailListResult, self).__init__(**kwargs) + self.value = value + + +class VpnClientIPsecParameters(msrest.serialization.Model): + """An IPSec parameters for a virtual network gateway P2S connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) lifetime in seconds for P2S client. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association (also called Quick Mode + or Phase 2 SA) payload size in KB for P2S client.. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE phase 1). Possible + values include: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", + "GCMAES256". + :type ipsec_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase 1). Possible values + include: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", "GCMAES256". + :type ipsec_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase 2). Possible values + include: "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES256", "GCMAES128". + :type ike_encryption: str or ~azure.mgmt.network.v2020_07_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). Possible values + include: "MD5", "SHA1", "SHA256", "SHA384", "GCMAES256", "GCMAES128". + :type ike_integrity: str or ~azure.mgmt.network.v2020_07_01.models.IkeIntegrity + :param dh_group: Required. The DH Group used in IKE Phase 1 for initial SA. Possible values + include: "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", + "DHGroup24". + :type dh_group: str or ~azure.mgmt.network.v2020_07_01.models.DhGroup + :param pfs_group: Required. The Pfs Group used in IKE Phase 2 for new child SA. Possible values + include: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", "PFSMM". + :type pfs_group: str or ~azure.mgmt.network.v2020_07_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + sa_life_time_seconds: int, + sa_data_size_kilobytes: int, + ipsec_encryption: Union[str, "IpsecEncryption"], + ipsec_integrity: Union[str, "IpsecIntegrity"], + ike_encryption: Union[str, "IkeEncryption"], + ike_integrity: Union[str, "IkeIntegrity"], + dh_group: Union[str, "DhGroup"], + pfs_group: Union[str, "PfsGroup"], + **kwargs + ): + super(VpnClientIPsecParameters, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group + + +class VpnClientParameters(msrest.serialization.Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible values include: + "Amd64", "X86". + :type processor_architecture: str or + ~azure.mgmt.network.v2020_07_01.models.ProcessorArchitecture + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_07_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the radius server + authentication certificate as a Base-64 encoded string. Required only if external radius + authentication has been configured with EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public certificate data + encoded as Base-64 strings. Optional parameter for external radius based authentication with + EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__( + self, + *, + processor_architecture: Optional[Union[str, "ProcessorArchitecture"]] = None, + authentication_method: Optional[Union[str, "AuthenticationMethod"]] = None, + radius_server_auth_certificate: Optional[str] = None, + client_root_certificates: Optional[List[str]] = None, + **kwargs + ): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked certificate + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.thumbprint = thumbprint + self.provisioning_state = None + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + public_cert_data: str, + id: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.public_cert_data = public_cert_data + self.provisioning_state = None + + +class VpnConnection(SubResource): + """VpnConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param remote_vpn_site: Id of the connected vpn site. + :type remote_vpn_site: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param routing_weight: Routing weight for vpn connection. + :type routing_weight: int + :param dpd_timeout_seconds: DPD timeout in seconds for vpn connection. + :type dpd_timeout_seconds: int + :ivar connection_status: The connection status. Possible values include: "Unknown", + "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or ~azure.mgmt.network.v2020_07_01.models.VpnConnectionStatus + :param vpn_connection_protocol_type: Connection protocol used for this connection. Possible + values include: "IKEv2", "IKEv1". + :type vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar ingress_bytes_transferred: Ingress bytes transferred. + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: Egress bytes transferred. + :vartype egress_bytes_transferred: long + :param connection_bandwidth: Expected bandwidth in MBPS. + :type connection_bandwidth: int + :param shared_key: SharedKey for the vpn connection. + :type shared_key: str + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param enable_rate_limiting: EnableBgp flag. + :type enable_rate_limiting: bool + :param enable_internet_security: Enable internet security. + :type enable_internet_security: bool + :param use_local_azure_ip_address: Use local azure ip to initiate connection. + :type use_local_azure_ip_address: bool + :ivar provisioning_state: The provisioning state of the VPN connection resource. Possible + values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param vpn_link_connections: List of all vpn site link connections to the gateway. + :type vpn_link_connections: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLinkConnection] + :param routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_07_01.models.RoutingConfiguration + """ + + _validation = { + 'etag': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'remote_vpn_site': {'key': 'properties.remoteVpnSite', 'type': 'SubResource'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'dpd_timeout_seconds': {'key': 'properties.dpdTimeoutSeconds', 'type': 'int'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'vpn_connection_protocol_type': {'key': 'properties.vpnConnectionProtocolType', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'connection_bandwidth': {'key': 'properties.connectionBandwidth', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'enable_rate_limiting': {'key': 'properties.enableRateLimiting', 'type': 'bool'}, + 'enable_internet_security': {'key': 'properties.enableInternetSecurity', 'type': 'bool'}, + 'use_local_azure_ip_address': {'key': 'properties.useLocalAzureIpAddress', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vpn_link_connections': {'key': 'properties.vpnLinkConnections', 'type': '[VpnSiteLinkConnection]'}, + 'routing_configuration': {'key': 'properties.routingConfiguration', 'type': 'RoutingConfiguration'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + remote_vpn_site: Optional["SubResource"] = None, + routing_weight: Optional[int] = None, + dpd_timeout_seconds: Optional[int] = None, + vpn_connection_protocol_type: Optional[Union[str, "VirtualNetworkGatewayConnectionProtocol"]] = None, + connection_bandwidth: Optional[int] = None, + shared_key: Optional[str] = None, + enable_bgp: Optional[bool] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["IpsecPolicy"]] = None, + enable_rate_limiting: Optional[bool] = None, + enable_internet_security: Optional[bool] = None, + use_local_azure_ip_address: Optional[bool] = None, + vpn_link_connections: Optional[List["VpnSiteLinkConnection"]] = None, + routing_configuration: Optional["RoutingConfiguration"] = None, + **kwargs + ): + super(VpnConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.remote_vpn_site = remote_vpn_site + self.routing_weight = routing_weight + self.dpd_timeout_seconds = dpd_timeout_seconds + self.connection_status = None + self.vpn_connection_protocol_type = vpn_connection_protocol_type + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.connection_bandwidth = connection_bandwidth + self.shared_key = shared_key + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.enable_rate_limiting = enable_rate_limiting + self.enable_internet_security = enable_internet_security + self.use_local_azure_ip_address = use_local_azure_ip_address + self.provisioning_state = None + self.vpn_link_connections = vpn_link_connections + self.routing_configuration = routing_configuration + + +class VpnConnectionPacketCaptureStartParameters(msrest.serialization.Model): + """Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. + + :param filter_data: Start Packet capture parameters on vpn connection. + :type filter_data: str + :param link_connection_names: List of site link connection names. + :type link_connection_names: list[str] + """ + + _attribute_map = { + 'filter_data': {'key': 'filterData', 'type': 'str'}, + 'link_connection_names': {'key': 'linkConnectionNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + filter_data: Optional[str] = None, + link_connection_names: Optional[List[str]] = None, + **kwargs + ): + super(VpnConnectionPacketCaptureStartParameters, self).__init__(**kwargs) + self.filter_data = filter_data + self.link_connection_names = link_connection_names + + +class VpnConnectionPacketCaptureStopParameters(msrest.serialization.Model): + """Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + + :param sas_url: SAS url for packet capture on vpn connection. + :type sas_url: str + :param link_connection_names: List of site link connection names. + :type link_connection_names: list[str] + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'link_connection_names': {'key': 'linkConnectionNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + link_connection_names: Optional[List[str]] = None, + **kwargs + ): + super(VpnConnectionPacketCaptureStopParameters, self).__init__(**kwargs) + self.sas_url = sas_url + self.link_connection_names = link_connection_names + + +class VpnDeviceScriptParameters(msrest.serialization.Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + vendor: Optional[str] = None, + device_family: Optional[str] = None, + firmware_version: Optional[str] = None, + **kwargs + ): + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = vendor + self.device_family = device_family + self.firmware_version = firmware_version + + +class VpnGateway(Resource): + """VpnGateway Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_hub: The VirtualHub to which the gateway belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param connections: List of all vpn connections to the gateway. + :type connections: list[~azure.mgmt.network.v2020_07_01.models.VpnConnection] + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :ivar provisioning_state: The provisioning state of the VPN gateway resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param vpn_gateway_scale_unit: The scale unit for this vpn gateway. + :type vpn_gateway_scale_unit: int + :ivar ip_configurations: List of all IPs configured on the gateway. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_07_01.models.VpnGatewayIpConfiguration] + :param is_routing_preference_internet: Enable Routing Preference property for the Public IP + Interface of the VpnGateway. + :type is_routing_preference_internet: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_hub': {'key': 'properties.virtualHub', 'type': 'SubResource'}, + 'connections': {'key': 'properties.connections', 'type': '[VpnConnection]'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vpn_gateway_scale_unit': {'key': 'properties.vpnGatewayScaleUnit', 'type': 'int'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VpnGatewayIpConfiguration]'}, + 'is_routing_preference_internet': {'key': 'properties.isRoutingPreferenceInternet', 'type': 'bool'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_hub: Optional["SubResource"] = None, + connections: Optional[List["VpnConnection"]] = None, + bgp_settings: Optional["BgpSettings"] = None, + vpn_gateway_scale_unit: Optional[int] = None, + is_routing_preference_internet: Optional[bool] = None, + **kwargs + ): + super(VpnGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_hub = virtual_hub + self.connections = connections + self.bgp_settings = bgp_settings + self.provisioning_state = None + self.vpn_gateway_scale_unit = vpn_gateway_scale_unit + self.ip_configurations = None + self.is_routing_preference_internet = is_routing_preference_internet + + +class VpnGatewayIpConfiguration(msrest.serialization.Model): + """IP Configuration of a VPN Gateway Resource. + + :param id: The identifier of the IP configuration for a VPN Gateway. + :type id: str + :param public_ip_address: The public IP address of this IP configuration. + :type public_ip_address: str + :param private_ip_address: The private IP address of this IP configuration. + :type private_ip_address: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + public_ip_address: Optional[str] = None, + private_ip_address: Optional[str] = None, + **kwargs + ): + super(VpnGatewayIpConfiguration, self).__init__(**kwargs) + self.id = id + self.public_ip_address = public_ip_address + self.private_ip_address = private_ip_address + + +class VpnGatewayPacketCaptureStartParameters(msrest.serialization.Model): + """Start packet capture parameters. + + :param filter_data: Start Packet capture parameters on vpn gateway. + :type filter_data: str + """ + + _attribute_map = { + 'filter_data': {'key': 'filterData', 'type': 'str'}, + } + + def __init__( + self, + *, + filter_data: Optional[str] = None, + **kwargs + ): + super(VpnGatewayPacketCaptureStartParameters, self).__init__(**kwargs) + self.filter_data = filter_data + + +class VpnGatewayPacketCaptureStopParameters(msrest.serialization.Model): + """Stop packet capture parameters. + + :param sas_url: SAS url for packet capture on vpn gateway. + :type sas_url: str + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + **kwargs + ): + super(VpnGatewayPacketCaptureStopParameters, self).__init__(**kwargs) + self.sas_url = sas_url + + +class VpnLinkBgpSettings(msrest.serialization.Model): + """BGP settings details for a link. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. + :type bgp_peering_address: str + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + asn: Optional[int] = None, + bgp_peering_address: Optional[str] = None, + **kwargs + ): + super(VpnLinkBgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + + +class VpnLinkProviderProperties(msrest.serialization.Model): + """List of properties of a link provider. + + :param link_provider_name: Name of the link provider. + :type link_provider_name: str + :param link_speed_in_mbps: Link speed. + :type link_speed_in_mbps: int + """ + + _attribute_map = { + 'link_provider_name': {'key': 'linkProviderName', 'type': 'str'}, + 'link_speed_in_mbps': {'key': 'linkSpeedInMbps', 'type': 'int'}, + } + + def __init__( + self, + *, + link_provider_name: Optional[str] = None, + link_speed_in_mbps: Optional[int] = None, + **kwargs + ): + super(VpnLinkProviderProperties, self).__init__(**kwargs) + self.link_provider_name = link_provider_name + self.link_speed_in_mbps = link_speed_in_mbps + + +class VpnPacketCaptureStartParameters(msrest.serialization.Model): + """Start packet capture parameters on virtual network gateway. + + :param filter_data: Start Packet capture parameters. + :type filter_data: str + """ + + _attribute_map = { + 'filter_data': {'key': 'filterData', 'type': 'str'}, + } + + def __init__( + self, + *, + filter_data: Optional[str] = None, + **kwargs + ): + super(VpnPacketCaptureStartParameters, self).__init__(**kwargs) + self.filter_data = filter_data + + +class VpnPacketCaptureStopParameters(msrest.serialization.Model): + """Stop packet capture parameters. + + :param sas_url: SAS url for packet capture on virtual network gateway. + :type sas_url: str + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + **kwargs + ): + super(VpnPacketCaptureStopParameters, self).__init__(**kwargs) + self.sas_url = sas_url + + +class VpnProfileResponse(msrest.serialization.Model): + """Vpn Profile Response for package generation. + + :param profile_url: URL to the VPN profile. + :type profile_url: str + """ + + _attribute_map = { + 'profile_url': {'key': 'profileUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + profile_url: Optional[str] = None, + **kwargs + ): + super(VpnProfileResponse, self).__init__(**kwargs) + self.profile_url = profile_url + + +class VpnServerConfigRadiusClientRootCertificate(msrest.serialization.Model): + """Properties of the Radius client root certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param thumbprint: The Radius client root certificate thumbprint. + :type thumbprint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(VpnServerConfigRadiusClientRootCertificate, self).__init__(**kwargs) + self.name = name + self.thumbprint = thumbprint + + +class VpnServerConfigRadiusServerRootCertificate(msrest.serialization.Model): + """Properties of Radius Server root certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param public_cert_data: The certificate public data. + :type public_cert_data: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_cert_data': {'key': 'publicCertData', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + public_cert_data: Optional[str] = None, + **kwargs + ): + super(VpnServerConfigRadiusServerRootCertificate, self).__init__(**kwargs) + self.name = name + self.public_cert_data = public_cert_data + + +class VpnServerConfiguration(Resource): + """VpnServerConfiguration Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param name_properties_name: The name of the VpnServerConfiguration that is unique within a + resource group. + :type name_properties_name: str + :param vpn_protocols: VPN protocols for the VpnServerConfiguration. + :type vpn_protocols: list[str or + ~azure.mgmt.network.v2020_07_01.models.VpnGatewayTunnelingProtocol] + :param vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :type vpn_authentication_types: list[str or + ~azure.mgmt.network.v2020_07_01.models.VpnAuthenticationType] + :param vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigVpnClientRootCertificate] + :param vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigVpnClientRevokedCertificate] + :param radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :type radius_server_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigRadiusServerRootCertificate] + :param radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :type radius_client_root_certificates: + list[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigRadiusClientRootCertificate] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param radius_server_address: The radius server address property of the VpnServerConfiguration + resource for point to site client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the VpnServerConfiguration resource + for point to site client connection. + :type radius_server_secret: str + :param radius_servers: Multiple Radius Server configuration for VpnServerConfiguration. + :type radius_servers: list[~azure.mgmt.network.v2020_07_01.models.RadiusServer] + :param aad_authentication_parameters: The set of aad vpn authentication parameters. + :type aad_authentication_parameters: + ~azure.mgmt.network.v2020_07_01.models.AadAuthenticationParameters + :ivar provisioning_state: The provisioning state of the VpnServerConfiguration resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar p2_s_vpn_gateways: List of references to P2SVpnGateways. + :vartype p2_s_vpn_gateways: list[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :ivar etag_properties_etag: A unique read-only string that changes whenever the resource is + updated. + :vartype etag_properties_etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'p2_s_vpn_gateways': {'readonly': True}, + 'etag_properties_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'vpn_protocols': {'key': 'properties.vpnProtocols', 'type': '[str]'}, + 'vpn_authentication_types': {'key': 'properties.vpnAuthenticationTypes', 'type': '[str]'}, + 'vpn_client_root_certificates': {'key': 'properties.vpnClientRootCertificates', 'type': '[VpnServerConfigVpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'properties.vpnClientRevokedCertificates', 'type': '[VpnServerConfigVpnClientRevokedCertificate]'}, + 'radius_server_root_certificates': {'key': 'properties.radiusServerRootCertificates', 'type': '[VpnServerConfigRadiusServerRootCertificate]'}, + 'radius_client_root_certificates': {'key': 'properties.radiusClientRootCertificates', 'type': '[VpnServerConfigRadiusClientRootCertificate]'}, + 'vpn_client_ipsec_policies': {'key': 'properties.vpnClientIpsecPolicies', 'type': '[IpsecPolicy]'}, + 'radius_server_address': {'key': 'properties.radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'properties.radiusServerSecret', 'type': 'str'}, + 'radius_servers': {'key': 'properties.radiusServers', 'type': '[RadiusServer]'}, + 'aad_authentication_parameters': {'key': 'properties.aadAuthenticationParameters', 'type': 'AadAuthenticationParameters'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'p2_s_vpn_gateways': {'key': 'properties.p2SVpnGateways', 'type': '[P2SVpnGateway]'}, + 'etag_properties_etag': {'key': 'properties.etag', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + name_properties_name: Optional[str] = None, + vpn_protocols: Optional[List[Union[str, "VpnGatewayTunnelingProtocol"]]] = None, + vpn_authentication_types: Optional[List[Union[str, "VpnAuthenticationType"]]] = None, + vpn_client_root_certificates: Optional[List["VpnServerConfigVpnClientRootCertificate"]] = None, + vpn_client_revoked_certificates: Optional[List["VpnServerConfigVpnClientRevokedCertificate"]] = None, + radius_server_root_certificates: Optional[List["VpnServerConfigRadiusServerRootCertificate"]] = None, + radius_client_root_certificates: Optional[List["VpnServerConfigRadiusClientRootCertificate"]] = None, + vpn_client_ipsec_policies: Optional[List["IpsecPolicy"]] = None, + radius_server_address: Optional[str] = None, + radius_server_secret: Optional[str] = None, + radius_servers: Optional[List["RadiusServer"]] = None, + aad_authentication_parameters: Optional["AadAuthenticationParameters"] = None, + **kwargs + ): + super(VpnServerConfiguration, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.name_properties_name = name_properties_name + self.vpn_protocols = vpn_protocols + self.vpn_authentication_types = vpn_authentication_types + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.radius_server_root_certificates = radius_server_root_certificates + self.radius_client_root_certificates = radius_client_root_certificates + self.vpn_client_ipsec_policies = vpn_client_ipsec_policies + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret + self.radius_servers = radius_servers + self.aad_authentication_parameters = aad_authentication_parameters + self.provisioning_state = None + self.p2_s_vpn_gateways = None + self.etag_properties_etag = None + + +class VpnServerConfigurationsResponse(msrest.serialization.Model): + """VpnServerConfigurations list associated with VirtualWan Response. + + :param vpn_server_configuration_resource_ids: List of VpnServerConfigurations associated with + VirtualWan. + :type vpn_server_configuration_resource_ids: list[str] + """ + + _attribute_map = { + 'vpn_server_configuration_resource_ids': {'key': 'vpnServerConfigurationResourceIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + vpn_server_configuration_resource_ids: Optional[List[str]] = None, + **kwargs + ): + super(VpnServerConfigurationsResponse, self).__init__(**kwargs) + self.vpn_server_configuration_resource_ids = vpn_server_configuration_resource_ids + + +class VpnServerConfigVpnClientRevokedCertificate(msrest.serialization.Model): + """Properties of the revoked VPN client certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(VpnServerConfigVpnClientRevokedCertificate, self).__init__(**kwargs) + self.name = name + self.thumbprint = thumbprint + + +class VpnServerConfigVpnClientRootCertificate(msrest.serialization.Model): + """Properties of VPN client root certificate of VpnServerConfiguration. + + :param name: The certificate name. + :type name: str + :param public_cert_data: The certificate public data. + :type public_cert_data: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_cert_data': {'key': 'publicCertData', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + public_cert_data: Optional[str] = None, + **kwargs + ): + super(VpnServerConfigVpnClientRootCertificate, self).__init__(**kwargs) + self.name = name + self.public_cert_data = public_cert_data + + +class VpnSite(Resource): + """VpnSite Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param virtual_wan: The VirtualWAN to which the vpnSite belongs. + :type virtual_wan: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param device_properties: The device properties. + :type device_properties: ~azure.mgmt.network.v2020_07_01.models.DeviceProperties + :param ip_address: The ip-address for the vpn-site. + :type ip_address: str + :param site_key: The key for vpn-site that can be used for connections. + :type site_key: str + :param address_space: The AddressSpace that contains an array of IP address ranges. + :type address_space: ~azure.mgmt.network.v2020_07_01.models.AddressSpace + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_07_01.models.BgpSettings + :ivar provisioning_state: The provisioning state of the VPN site resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :param is_security_site: IsSecuritySite flag. + :type is_security_site: bool + :param vpn_site_links: List of all vpn site links. + :type vpn_site_links: list[~azure.mgmt.network.v2020_07_01.models.VpnSiteLink] + :param o365_policy: Office365 Policy. + :type o365_policy: ~azure.mgmt.network.v2020_07_01.models.O365PolicyProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'virtual_wan': {'key': 'properties.virtualWan', 'type': 'SubResource'}, + 'device_properties': {'key': 'properties.deviceProperties', 'type': 'DeviceProperties'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'site_key': {'key': 'properties.siteKey', 'type': 'str'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'bgp_properties': {'key': 'properties.bgpProperties', 'type': 'BgpSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_security_site': {'key': 'properties.isSecuritySite', 'type': 'bool'}, + 'vpn_site_links': {'key': 'properties.vpnSiteLinks', 'type': '[VpnSiteLink]'}, + 'o365_policy': {'key': 'properties.o365Policy', 'type': 'O365PolicyProperties'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_wan: Optional["SubResource"] = None, + device_properties: Optional["DeviceProperties"] = None, + ip_address: Optional[str] = None, + site_key: Optional[str] = None, + address_space: Optional["AddressSpace"] = None, + bgp_properties: Optional["BgpSettings"] = None, + is_security_site: Optional[bool] = None, + vpn_site_links: Optional[List["VpnSiteLink"]] = None, + o365_policy: Optional["O365PolicyProperties"] = None, + **kwargs + ): + super(VpnSite, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.virtual_wan = virtual_wan + self.device_properties = device_properties + self.ip_address = ip_address + self.site_key = site_key + self.address_space = address_space + self.bgp_properties = bgp_properties + self.provisioning_state = None + self.is_security_site = is_security_site + self.vpn_site_links = vpn_site_links + self.o365_policy = o365_policy + + +class VpnSiteId(msrest.serialization.Model): + """VpnSite Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vpn_site: The resource-uri of the vpn-site for which config is to be fetched. + :vartype vpn_site: str + """ + + _validation = { + 'vpn_site': {'readonly': True}, + } + + _attribute_map = { + 'vpn_site': {'key': 'vpnSite', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VpnSiteId, self).__init__(**kwargs) + self.vpn_site = None + + +class VpnSiteLink(SubResource): + """VpnSiteLink Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar type: Resource type. + :vartype type: str + :param link_properties: The link provider properties. + :type link_properties: ~azure.mgmt.network.v2020_07_01.models.VpnLinkProviderProperties + :param ip_address: The ip-address for the vpn-site-link. + :type ip_address: str + :param fqdn: FQDN of vpn-site-link. + :type fqdn: str + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_07_01.models.VpnLinkBgpSettings + :ivar provisioning_state: The provisioning state of the VPN site link resource. Possible values + include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'link_properties': {'key': 'properties.linkProperties', 'type': 'VpnLinkProviderProperties'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'bgp_properties': {'key': 'properties.bgpProperties', 'type': 'VpnLinkBgpSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + link_properties: Optional["VpnLinkProviderProperties"] = None, + ip_address: Optional[str] = None, + fqdn: Optional[str] = None, + bgp_properties: Optional["VpnLinkBgpSettings"] = None, + **kwargs + ): + super(VpnSiteLink, self).__init__(id=id, **kwargs) + self.etag = None + self.name = name + self.type = None + self.link_properties = link_properties + self.ip_address = ip_address + self.fqdn = fqdn + self.bgp_properties = bgp_properties + self.provisioning_state = None + + +class VpnSiteLinkConnection(SubResource): + """VpnSiteLinkConnection Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :param name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param vpn_site_link: Id of the connected vpn site link. + :type vpn_site_link: ~azure.mgmt.network.v2020_07_01.models.SubResource + :param routing_weight: Routing weight for vpn connection. + :type routing_weight: int + :ivar connection_status: The connection status. Possible values include: "Unknown", + "Connecting", "Connected", "NotConnected". + :vartype connection_status: str or ~azure.mgmt.network.v2020_07_01.models.VpnConnectionStatus + :param vpn_connection_protocol_type: Connection protocol used for this connection. Possible + values include: "IKEv2", "IKEv1". + :type vpn_connection_protocol_type: str or + ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionProtocol + :ivar ingress_bytes_transferred: Ingress bytes transferred. + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: Egress bytes transferred. + :vartype egress_bytes_transferred: long + :param connection_bandwidth: Expected bandwidth in MBPS. + :type connection_bandwidth: int + :param shared_key: SharedKey for the vpn connection. + :type shared_key: str + :param enable_bgp: EnableBgp flag. + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this connection. + :type ipsec_policies: list[~azure.mgmt.network.v2020_07_01.models.IpsecPolicy] + :param enable_rate_limiting: EnableBgp flag. + :type enable_rate_limiting: bool + :param use_local_azure_ip_address: Use local azure ip to initiate connection. + :type use_local_azure_ip_address: bool + :ivar provisioning_state: The provisioning state of the VPN site link connection resource. + Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vpn_site_link': {'key': 'properties.vpnSiteLink', 'type': 'SubResource'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'vpn_connection_protocol_type': {'key': 'properties.vpnConnectionProtocolType', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'connection_bandwidth': {'key': 'properties.connectionBandwidth', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'enable_rate_limiting': {'key': 'properties.enableRateLimiting', 'type': 'bool'}, + 'use_local_azure_ip_address': {'key': 'properties.useLocalAzureIpAddress', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + vpn_site_link: Optional["SubResource"] = None, + routing_weight: Optional[int] = None, + vpn_connection_protocol_type: Optional[Union[str, "VirtualNetworkGatewayConnectionProtocol"]] = None, + connection_bandwidth: Optional[int] = None, + shared_key: Optional[str] = None, + enable_bgp: Optional[bool] = None, + use_policy_based_traffic_selectors: Optional[bool] = None, + ipsec_policies: Optional[List["IpsecPolicy"]] = None, + enable_rate_limiting: Optional[bool] = None, + use_local_azure_ip_address: Optional[bool] = None, + **kwargs + ): + super(VpnSiteLinkConnection, self).__init__(id=id, **kwargs) + self.name = name + self.etag = None + self.type = None + self.vpn_site_link = vpn_site_link + self.routing_weight = routing_weight + self.connection_status = None + self.vpn_connection_protocol_type = vpn_connection_protocol_type + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.connection_bandwidth = connection_bandwidth + self.shared_key = shared_key + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.enable_rate_limiting = enable_rate_limiting + self.use_local_azure_ip_address = use_local_azure_ip_address + self.provisioning_state = None + + +class WebApplicationFirewallCustomRule(msrest.serialization.Model): + """Defines contents of a web application rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: The name of the resource that is unique within a policy. This name can be used to + access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param priority: Required. Priority of the rule. Rules with a lower value will be evaluated + before rules with a higher value. + :type priority: int + :param rule_type: Required. The rule type. Possible values include: "MatchRule", "Invalid". + :type rule_type: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallRuleType + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.network.v2020_07_01.models.MatchCondition] + :param action: Required. Type of Actions. Possible values include: "Allow", "Block", "Log". + :type action: str or ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallAction + """ + + _validation = { + 'name': {'max_length': 128, 'min_length': 0}, + 'etag': {'readonly': True}, + 'priority': {'required': True}, + 'rule_type': {'required': True}, + 'match_conditions': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'match_conditions': {'key': 'matchConditions', 'type': '[MatchCondition]'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + priority: int, + rule_type: Union[str, "WebApplicationFirewallRuleType"], + match_conditions: List["MatchCondition"], + action: Union[str, "WebApplicationFirewallAction"], + name: Optional[str] = None, + **kwargs + ): + super(WebApplicationFirewallCustomRule, self).__init__(**kwargs) + self.name = name + self.etag = None + self.priority = priority + self.rule_type = rule_type + self.match_conditions = match_conditions + self.action = action + + +class WebApplicationFirewallPolicy(Resource): + """Defines web application firewall policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :param policy_settings: The PolicySettings for policy. + :type policy_settings: ~azure.mgmt.network.v2020_07_01.models.PolicySettings + :param custom_rules: The custom rules inside the policy. + :type custom_rules: + list[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2020_07_01.models.ApplicationGateway] + :ivar provisioning_state: The provisioning state of the web application firewall policy + resource. Possible values include: "Succeeded", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or ~azure.mgmt.network.v2020_07_01.models.ProvisioningState + :ivar resource_state: Resource status of the policy. Possible values include: "Creating", + "Enabling", "Enabled", "Disabling", "Disabled", "Deleting". + :vartype resource_state: str or + ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicyResourceState + :param managed_rules: Describes the managedRules structure. + :type managed_rules: ~azure.mgmt.network.v2020_07_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + :ivar path_based_rules: A collection of references to application gateway path rules. + :vartype path_based_rules: list[~azure.mgmt.network.v2020_07_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'application_gateways': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_state': {'readonly': True}, + 'http_listeners': {'readonly': True}, + 'path_based_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'policy_settings': {'key': 'properties.policySettings', 'type': 'PolicySettings'}, + 'custom_rules': {'key': 'properties.customRules', 'type': '[WebApplicationFirewallCustomRule]'}, + 'application_gateways': {'key': 'properties.applicationGateways', 'type': '[ApplicationGateway]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_state': {'key': 'properties.resourceState', 'type': 'str'}, + 'managed_rules': {'key': 'properties.managedRules', 'type': 'ManagedRulesDefinition'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[SubResource]'}, + 'path_based_rules': {'key': 'properties.pathBasedRules', 'type': '[SubResource]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + policy_settings: Optional["PolicySettings"] = None, + custom_rules: Optional[List["WebApplicationFirewallCustomRule"]] = None, + managed_rules: Optional["ManagedRulesDefinition"] = None, + **kwargs + ): + super(WebApplicationFirewallPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + self.policy_settings = policy_settings + self.custom_rules = custom_rules + self.application_gateways = None + self.provisioning_state = None + self.resource_state = None + self.managed_rules = managed_rules + self.http_listeners = None + self.path_based_rules = None + + +class WebApplicationFirewallPolicyListResult(msrest.serialization.Model): + """Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of WebApplicationFirewallPolicies within a resource group. + :vartype value: list[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy] + :ivar next_link: URL to get the next set of WebApplicationFirewallPolicy objects if there are + any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebApplicationFirewallPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebApplicationFirewallPolicyListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_network_management_client_enums.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_network_management_client_enums.py new file mode 100644 index 0000000000000..eb064ba8b6954 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/models/_network_management_client_enums.py @@ -0,0 +1,1318 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class Access(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access to be allowed or denied. + """ + + ALLOW = "Allow" + DENY = "Deny" + +class ApplicationGatewayBackendHealthServerHealth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Health of backend server. + """ + + UNKNOWN = "Unknown" + UP = "Up" + DOWN = "Down" + PARTIAL = "Partial" + DRAINING = "Draining" + +class ApplicationGatewayCookieBasedAffinity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Cookie based affinity. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ApplicationGatewayCustomErrorStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status code of the application gateway customer error. + """ + + HTTP_STATUS403 = "HttpStatus403" + HTTP_STATUS502 = "HttpStatus502" + +class ApplicationGatewayFirewallMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Web application firewall mode. + """ + + DETECTION = "Detection" + PREVENTION = "Prevention" + +class ApplicationGatewayOperationalState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operational state of the application gateway resource. + """ + + STOPPED = "Stopped" + STARTING = "Starting" + RUNNING = "Running" + STOPPING = "Stopping" + +class ApplicationGatewayProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Application Gateway protocol. + """ + + HTTP = "Http" + HTTPS = "Https" + +class ApplicationGatewayRedirectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Redirect type enum. + """ + + PERMANENT = "Permanent" + FOUND = "Found" + SEE_OTHER = "SeeOther" + TEMPORARY = "Temporary" + +class ApplicationGatewayRequestRoutingRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rule type. + """ + + BASIC = "Basic" + PATH_BASED_ROUTING = "PathBasedRouting" + +class ApplicationGatewaySkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of an application gateway SKU. + """ + + STANDARD_SMALL = "Standard_Small" + STANDARD_MEDIUM = "Standard_Medium" + STANDARD_LARGE = "Standard_Large" + WAF_MEDIUM = "WAF_Medium" + WAF_LARGE = "WAF_Large" + STANDARD_V2 = "Standard_v2" + WAF_V2 = "WAF_v2" + +class ApplicationGatewaySslCipherSuite(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Ssl cipher suites enums. + """ + + TLS_ECDHE_RSA_WITH_AES256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + TLS_ECDHE_RSA_WITH_AES128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + TLS_ECDHE_RSA_WITH_AES256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + TLS_ECDHE_RSA_WITH_AES128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + TLS_DHE_RSA_WITH_AES256_GCM_SHA384 = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + TLS_DHE_RSA_WITH_AES128_GCM_SHA256 = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + TLS_DHE_RSA_WITH_AES256_CBC_SHA = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + TLS_DHE_RSA_WITH_AES128_CBC_SHA = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + TLS_RSA_WITH_AES256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" + TLS_RSA_WITH_AES128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" + TLS_RSA_WITH_AES256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" + TLS_RSA_WITH_AES128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" + TLS_RSA_WITH_AES256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" + TLS_RSA_WITH_AES128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" + TLS_ECDHE_ECDSA_WITH_AES256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + TLS_ECDHE_ECDSA_WITH_AES128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + TLS_ECDHE_ECDSA_WITH_AES256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + TLS_ECDHE_ECDSA_WITH_AES256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + TLS_DHE_DSS_WITH_AES256_CBC_SHA256 = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + TLS_DHE_DSS_WITH_AES128_CBC_SHA256 = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + TLS_DHE_DSS_WITH_AES256_CBC_SHA = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + TLS_DHE_DSS_WITH_AES128_CBC_SHA = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + TLS_RSA_WITH3_DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + TLS_DHE_DSS_WITH3_DES_EDE_CBC_SHA = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + TLS_ECDHE_RSA_WITH_AES128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + TLS_ECDHE_RSA_WITH_AES256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + +class ApplicationGatewaySslPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Ssl predefined policy name enums. + """ + + APP_GW_SSL_POLICY20150501 = "AppGwSslPolicy20150501" + APP_GW_SSL_POLICY20170401 = "AppGwSslPolicy20170401" + APP_GW_SSL_POLICY20170401_S = "AppGwSslPolicy20170401S" + +class ApplicationGatewaySslPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of Ssl Policy. + """ + + PREDEFINED = "Predefined" + CUSTOM = "Custom" + +class ApplicationGatewaySslProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Ssl protocol enums. + """ + + TL_SV1_0 = "TLSv1_0" + TL_SV1_1 = "TLSv1_1" + TL_SV1_2 = "TLSv1_2" + +class ApplicationGatewayTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of an application gateway. + """ + + STANDARD = "Standard" + WAF = "WAF" + STANDARD_V2 = "Standard_v2" + WAF_V2 = "WAF_v2" + +class AssociationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The association type of the child resource to the parent resource. + """ + + ASSOCIATED = "Associated" + CONTAINS = "Contains" + +class AuthenticationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """VPN client authentication method. + """ + + EAPTLS = "EAPTLS" + EAPMSCHA_PV2 = "EAPMSCHAPv2" + +class AuthorizationUseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authorization use status. + """ + + AVAILABLE = "Available" + IN_USE = "InUse" + +class AzureFirewallApplicationRuleProtocolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol type of a Application Rule resource. + """ + + HTTP = "Http" + HTTPS = "Https" + MSSQL = "Mssql" + +class AzureFirewallNatRCActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action type of a NAT rule collection. + """ + + SNAT = "Snat" + DNAT = "Dnat" + +class AzureFirewallNetworkRuleProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol of a Network Rule resource. + """ + + TCP = "TCP" + UDP = "UDP" + ANY = "Any" + ICMP = "ICMP" + +class AzureFirewallRCActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action type of a rule collection. + """ + + ALLOW = "Allow" + DENY = "Deny" + +class AzureFirewallSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of an Azure Firewall SKU. + """ + + AZFW_VNET = "AZFW_VNet" + AZFW_HUB = "AZFW_Hub" + +class AzureFirewallSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of an Azure Firewall. + """ + + STANDARD = "Standard" + PREMIUM = "Premium" + +class AzureFirewallThreatIntelMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operation mode for Threat Intel. + """ + + ALERT = "Alert" + DENY = "Deny" + OFF = "Off" + +class BastionConnectProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol used to connect to the target. + """ + + SSH = "SSH" + RDP = "RDP" + +class BgpPeerState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The BGP peer state. + """ + + UNKNOWN = "Unknown" + STOPPED = "Stopped" + IDLE = "Idle" + CONNECTING = "Connecting" + CONNECTED = "Connected" + +class CircuitConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Express Route Circuit connection state. + """ + + CONNECTED = "Connected" + CONNECTING = "Connecting" + DISCONNECTED = "Disconnected" + +class CommissionedState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The commissioned state of the Custom IP Prefix. + """ + + PROVISIONING = "Provisioning" + PROVISIONED = "Provisioned" + COMMISSIONING = "Commissioning" + COMMISSIONED = "Commissioned" + DECOMMISSIONING = "Decommissioning" + DEPROVISIONING = "Deprovisioning" + +class ConnectionMonitorEndpointFilterItemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of item included in the filter. Currently only 'AgentAddress' is supported. + """ + + AGENT_ADDRESS = "AgentAddress" + +class ConnectionMonitorEndpointFilterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The behavior of the endpoint filter. Currently only 'Include' is supported. + """ + + INCLUDE = "Include" + +class ConnectionMonitorSourceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of connection monitor source. + """ + + UNKNOWN = "Unknown" + ACTIVE = "Active" + INACTIVE = "Inactive" + +class ConnectionMonitorTestConfigurationProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol to use in test evaluation. + """ + + TCP = "Tcp" + HTTP = "Http" + ICMP = "Icmp" + +class ConnectionMonitorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of connection monitor. + """ + + MULTI_ENDPOINT = "MultiEndpoint" + SINGLE_SOURCE_DESTINATION = "SingleSourceDestination" + +class ConnectionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The connection state. + """ + + REACHABLE = "Reachable" + UNREACHABLE = "Unreachable" + UNKNOWN = "Unknown" + +class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The connection status. + """ + + UNKNOWN = "Unknown" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DEGRADED = "Degraded" + +class CoverageLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Test coverage for the endpoint. + """ + + DEFAULT = "Default" + LOW = "Low" + BELOW_AVERAGE = "BelowAverage" + AVERAGE = "Average" + ABOVE_AVERAGE = "AboveAverage" + FULL = "Full" + +class DdosCustomPolicyProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol for which the DDoS protection policy is being customized. + """ + + TCP = "Tcp" + UDP = "Udp" + SYN = "Syn" + +class DdosCustomPolicyTriggerSensitivityOverride(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The customized DDoS protection trigger rate sensitivity degrees. High: Trigger rate set with + most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate sensitivity + w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. + Relaxed: Trigger rate set with least sensitivity w.r.t. normal traffic. + """ + + RELAXED = "Relaxed" + LOW = "Low" + DEFAULT = "Default" + HIGH = "High" + +class DdosSettingsProtectionCoverage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The DDoS protection policy customizability of the public IP. Only standard coverage will have + the ability to be customized. + """ + + BASIC = "Basic" + STANDARD = "Standard" + +class DestinationPortBehavior(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Destination port behavior. + """ + + NONE = "None" + LISTEN_IF_AVAILABLE = "ListenIfAvailable" + +class DhGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The DH Groups used in IKE Phase 1 for initial SA. + """ + + NONE = "None" + DH_GROUP1 = "DHGroup1" + DH_GROUP2 = "DHGroup2" + DH_GROUP14 = "DHGroup14" + DH_GROUP2048 = "DHGroup2048" + ECP256 = "ECP256" + ECP384 = "ECP384" + DH_GROUP24 = "DHGroup24" + +class Direction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The direction of the traffic. + """ + + INBOUND = "Inbound" + OUTBOUND = "Outbound" + +class EffectiveRouteSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Who created the route. + """ + + UNKNOWN = "Unknown" + USER = "User" + VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" + DEFAULT = "Default" + +class EffectiveRouteState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The value of effective route. + """ + + ACTIVE = "Active" + INVALID = "Invalid" + +class EffectiveSecurityRuleProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The network protocol this rule applies to. + """ + + TCP = "Tcp" + UDP = "Udp" + ALL = "All" + +class EndpointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The endpoint type. + """ + + AZURE_VM = "AzureVM" + AZURE_V_NET = "AzureVNet" + AZURE_SUBNET = "AzureSubnet" + EXTERNAL_ADDRESS = "ExternalAddress" + MMA_WORKSPACE_MACHINE = "MMAWorkspaceMachine" + MMA_WORKSPACE_NETWORK = "MMAWorkspaceNetwork" + +class EvaluationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Connectivity analysis evaluation state. + """ + + NOT_STARTED = "NotStarted" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The advertised public prefix state of the Peering resource. + """ + + NOT_CONFIGURED = "NotConfigured" + CONFIGURING = "Configuring" + CONFIGURED = "Configured" + VALIDATION_NEEDED = "ValidationNeeded" + +class ExpressRouteCircuitPeeringState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of peering. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class ExpressRouteCircuitSkuFamily(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The family of the SKU. + """ + + UNLIMITED_DATA = "UnlimitedData" + METERED_DATA = "MeteredData" + +class ExpressRouteCircuitSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The tier of the SKU. + """ + + STANDARD = "Standard" + PREMIUM = "Premium" + BASIC = "Basic" + LOCAL = "Local" + +class ExpressRouteLinkAdminState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Administrative state of the physical port. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ExpressRouteLinkConnectorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Physical fiber port type. + """ + + LC = "LC" + SC = "SC" + +class ExpressRouteLinkMacSecCipher(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Mac security cipher. + """ + + GCM_AES256 = "GcmAes256" + GCM_AES128 = "GcmAes128" + GCM_AES_XPN128 = "GcmAesXpn128" + GCM_AES_XPN256 = "GcmAesXpn256" + +class ExpressRouteLinkMacSecSciState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sci mode enabled/disabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class ExpressRoutePeeringState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of peering. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class ExpressRoutePeeringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The peering type. + """ + + AZURE_PUBLIC_PEERING = "AzurePublicPeering" + AZURE_PRIVATE_PEERING = "AzurePrivatePeering" + MICROSOFT_PEERING = "MicrosoftPeering" + +class ExpressRoutePortsEncapsulation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Encapsulation method on physical ports. + """ + + DOT1_Q = "Dot1Q" + QIN_Q = "QinQ" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The supported ExtendedLocation types. Currently only EdgeZone is supported in Microsoft.Network + resources. + """ + + EDGE_ZONE = "EdgeZone" + +class FirewallPolicyFilterRuleCollectionActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action type of a rule. + """ + + ALLOW = "Allow" + DENY = "Deny" + +class FirewallPolicyIntrusionDetectionProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Possible intrusion detection bypass traffic protocols. + """ + + TCP = "TCP" + UDP = "UDP" + ICMP = "ICMP" + ANY = "ANY" + +class FirewallPolicyIntrusionDetectionStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Possible state values. + """ + + OFF = "Off" + ALERT = "Alert" + DENY = "Deny" + +class FirewallPolicyNatRuleCollectionActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action type of a rule. + """ + + DNAT = "DNAT" + +class FirewallPolicyRuleApplicationProtocolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The application protocol type of a Rule. + """ + + HTTP = "Http" + HTTPS = "Https" + +class FirewallPolicyRuleCollectionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the rule collection. + """ + + FIREWALL_POLICY_NAT_RULE_COLLECTION = "FirewallPolicyNatRuleCollection" + FIREWALL_POLICY_FILTER_RULE_COLLECTION = "FirewallPolicyFilterRuleCollection" + +class FirewallPolicyRuleNetworkProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Network protocol of a Rule. + """ + + TCP = "TCP" + UDP = "UDP" + ANY = "Any" + ICMP = "ICMP" + +class FirewallPolicyRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rule Type. + """ + + APPLICATION_RULE = "ApplicationRule" + NETWORK_RULE = "NetworkRule" + NAT_RULE = "NatRule" + +class FirewallPolicySkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of Firewall Policy. + """ + + STANDARD = "Standard" + PREMIUM = "Premium" + +class FlowLogFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The file type of flow log. + """ + + JSON = "JSON" + +class HTTPConfigurationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The HTTP method to use. + """ + + GET = "Get" + POST = "Post" + +class HTTPMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """HTTP method. + """ + + GET = "Get" + +class HubBgpConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current state of the VirtualHub to Peer. + """ + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + +class HubVirtualNetworkConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current state of the VirtualHub to vnet connection. + """ + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + +class IkeEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IKE encryption algorithm (IKE phase 2). + """ + + DES = "DES" + DES3 = "DES3" + AES128 = "AES128" + AES192 = "AES192" + AES256 = "AES256" + GCMAES256 = "GCMAES256" + GCMAES128 = "GCMAES128" + +class IkeIntegrity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IKE integrity algorithm (IKE phase 2). + """ + + MD5 = "MD5" + SHA1 = "SHA1" + SHA256 = "SHA256" + SHA384 = "SHA384" + GCMAES256 = "GCMAES256" + GCMAES128 = "GCMAES128" + +class InboundSecurityRulesProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Protocol. This should be either TCP or UDP. + """ + + TCP = "TCP" + UDP = "UDP" + +class IPAllocationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """IP address allocation method. + """ + + STATIC = "Static" + DYNAMIC = "Dynamic" + +class IpAllocationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """IpAllocation type. + """ + + UNDEFINED = "Undefined" + HYPERNET = "Hypernet" + +class IpFlowProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Protocol to be verified on. + """ + + TCP = "TCP" + UDP = "UDP" + +class IpsecEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IPSec encryption algorithm (IKE phase 1). + """ + + NONE = "None" + DES = "DES" + DES3 = "DES3" + AES128 = "AES128" + AES192 = "AES192" + AES256 = "AES256" + GCMAES128 = "GCMAES128" + GCMAES192 = "GCMAES192" + GCMAES256 = "GCMAES256" + +class IpsecIntegrity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IPSec integrity algorithm (IKE phase 1). + """ + + MD5 = "MD5" + SHA1 = "SHA1" + SHA256 = "SHA256" + GCMAES128 = "GCMAES128" + GCMAES192 = "GCMAES192" + GCMAES256 = "GCMAES256" + +class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """IP address version. + """ + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + +class IssueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of issue. + """ + + UNKNOWN = "Unknown" + AGENT_STOPPED = "AgentStopped" + GUEST_FIREWALL = "GuestFirewall" + DNS_RESOLUTION = "DnsResolution" + SOCKET_BIND = "SocketBind" + NETWORK_SECURITY_RULE = "NetworkSecurityRule" + USER_DEFINED_ROUTE = "UserDefinedRoute" + PORT_THROTTLED = "PortThrottled" + PLATFORM = "Platform" + +class LoadBalancerOutboundRuleProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol for the outbound rule in load balancer. + """ + + TCP = "Tcp" + UDP = "Udp" + ALL = "All" + +class LoadBalancerSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of a load balancer SKU. + """ + + BASIC = "Basic" + STANDARD = "Standard" + +class LoadBalancerSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a load balancer SKU. + """ + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + +class LoadDistribution(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The load distribution policy for this rule. + """ + + DEFAULT = "Default" + SOURCE_IP = "SourceIP" + SOURCE_IP_PROTOCOL = "SourceIPProtocol" + +class ManagedRuleEnabledState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of the managed rule. Defaults to Disabled if not specified. + """ + + DISABLED = "Disabled" + +class NatGatewaySkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of Nat Gateway SKU. + """ + + STANDARD = "Standard" + +class NetworkOperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the Azure async operation. + """ + + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class NextHopType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Next hop type. + """ + + INTERNET = "Internet" + VIRTUAL_APPLIANCE = "VirtualAppliance" + VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" + VNET_LOCAL = "VnetLocal" + HYPER_NET_GATEWAY = "HyperNetGateway" + NONE = "None" + +class OfficeTrafficCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The office traffic category. + """ + + OPTIMIZE = "Optimize" + OPTIMIZE_AND_ALLOW = "OptimizeAndAllow" + ALL = "All" + NONE = "None" + +class Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The origin of the issue. + """ + + LOCAL = "Local" + INBOUND = "Inbound" + OUTBOUND = "Outbound" + +class OutputType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Connection monitor output destination type. Currently, only "Workspace" is supported. + """ + + WORKSPACE = "Workspace" + +class OwaspCrsExclusionEntryMatchVariable(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The variable to be excluded. + """ + + REQUEST_HEADER_NAMES = "RequestHeaderNames" + REQUEST_COOKIE_NAMES = "RequestCookieNames" + REQUEST_ARG_NAMES = "RequestArgNames" + +class OwaspCrsExclusionEntrySelectorMatchOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """When matchVariable is a collection, operate on the selector to specify which elements in the + collection this exclusion applies to. + """ + + EQUALS = "Equals" + CONTAINS = "Contains" + STARTS_WITH = "StartsWith" + ENDS_WITH = "EndsWith" + EQUALS_ANY = "EqualsAny" + +class PcError(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INTERNAL_ERROR = "InternalError" + AGENT_STOPPED = "AgentStopped" + CAPTURE_FAILED = "CaptureFailed" + LOCAL_FILE_FAILED = "LocalFileFailed" + STORAGE_FAILED = "StorageFailed" + +class PcProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Protocol to be filtered on. + """ + + TCP = "TCP" + UDP = "UDP" + ANY = "Any" + +class PcStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the packet capture session. + """ + + NOT_STARTED = "NotStarted" + RUNNING = "Running" + STOPPED = "Stopped" + ERROR = "Error" + UNKNOWN = "Unknown" + +class PfsGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Pfs Groups used in IKE Phase 2 for new child SA. + """ + + NONE = "None" + PFS1 = "PFS1" + PFS2 = "PFS2" + PFS2048 = "PFS2048" + ECP256 = "ECP256" + ECP384 = "ECP384" + PFS24 = "PFS24" + PFS14 = "PFS14" + PFSMM = "PFSMM" + +class PreferredIPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The preferred IP version to use in test evaluation. The connection monitor may choose to use a + different version depending on other parameters. + """ + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + +class ProbeProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe + to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI + is required for the probe to be successful. + """ + + HTTP = "Http" + TCP = "Tcp" + HTTPS = "Https" + +class ProcessorArchitecture(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """VPN client Processor Architecture. + """ + + AMD64 = "Amd64" + X86 = "X86" + +class Protocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network protocol. + """ + + TCP = "Tcp" + HTTP = "Http" + HTTPS = "Https" + ICMP = "Icmp" + +class ProtocolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """RNM supported protocol types. + """ + + DO_NOT_USE = "DoNotUse" + ICMP = "Icmp" + TCP = "Tcp" + UDP = "Udp" + GRE = "Gre" + ESP = "Esp" + AH = "Ah" + VXLAN = "Vxlan" + ALL = "All" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + DELETING = "Deleting" + FAILED = "Failed" + +class PublicIPAddressSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of a public IP address SKU. + """ + + BASIC = "Basic" + STANDARD = "Standard" + +class PublicIPAddressSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a public IP address SKU. + """ + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + +class PublicIPPrefixSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of a public IP prefix SKU. + """ + + STANDARD = "Standard" + +class PublicIPPrefixSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a public IP prefix SKU. + """ + + REGIONAL = "Regional" + GLOBAL_ENUM = "Global" + +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes + both an implicitly created identity and a set of user assigned identities. The type 'None' will + remove any identities from the virtual machine. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class RouteFilterRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The rule type of the rule. + """ + + COMMUNITY = "Community" + +class RouteNextHopType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of Azure hop the packet should be sent to. + """ + + VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" + VNET_LOCAL = "VnetLocal" + INTERNET = "Internet" + VIRTUAL_APPLIANCE = "VirtualAppliance" + NONE = "None" + +class RoutingState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current routing state of the VirtualHub. + """ + + NONE = "None" + PROVISIONED = "Provisioned" + PROVISIONING = "Provisioning" + FAILED = "Failed" + +class SecurityPartnerProviderConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current state of the connection with Security Partner Provider. + """ + + UNKNOWN = "Unknown" + PARTIALLY_CONNECTED = "PartiallyConnected" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + +class SecurityProviderName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Security Providers. + """ + + Z_SCALER = "ZScaler" + I_BOSS = "IBoss" + CHECKPOINT = "Checkpoint" + +class SecurityRuleAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether network traffic is allowed or denied. + """ + + ALLOW = "Allow" + DENY = "Deny" + +class SecurityRuleDirection(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The direction of the rule. The direction specifies if rule will be evaluated on incoming or + outgoing traffic. + """ + + INBOUND = "Inbound" + OUTBOUND = "Outbound" + +class SecurityRuleProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network protocol this rule applies to. + """ + + TCP = "Tcp" + UDP = "Udp" + ICMP = "Icmp" + ESP = "Esp" + ASTERISK = "*" + AH = "Ah" + +class ServiceProviderProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The ServiceProviderProvisioningState state of the resource. + """ + + NOT_PROVISIONED = "NotProvisioned" + PROVISIONING = "Provisioning" + PROVISIONED = "Provisioned" + DEPROVISIONING = "Deprovisioning" + +class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The severity of the issue. + """ + + ERROR = "Error" + WARNING = "Warning" + +class TransportProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The transport protocol for the endpoint. + """ + + UDP = "Udp" + TCP = "Tcp" + ALL = "All" + +class TunnelConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current state of the tunnel. + """ + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + +class UsageUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """An enum describing the unit of measurement. + """ + + COUNT = "Count" + +class VerbosityLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Verbosity level. + """ + + NORMAL = "Normal" + MINIMUM = "Minimum" + FULL = "Full" + +class VirtualNetworkGatewayConnectionMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gateway connection type. + """ + + DEFAULT = "Default" + RESPONDER_ONLY = "ResponderOnly" + INITIATOR_ONLY = "InitiatorOnly" + +class VirtualNetworkGatewayConnectionProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gateway connection protocol. + """ + + IK_EV2 = "IKEv2" + IK_EV1 = "IKEv1" + +class VirtualNetworkGatewayConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Virtual Network Gateway connection status. + """ + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + +class VirtualNetworkGatewayConnectionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gateway connection type. + """ + + I_PSEC = "IPsec" + VNET2_VNET = "Vnet2Vnet" + EXPRESS_ROUTE = "ExpressRoute" + VPN_CLIENT = "VPNClient" + +class VirtualNetworkGatewaySkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gateway SKU name. + """ + + BASIC = "Basic" + HIGH_PERFORMANCE = "HighPerformance" + STANDARD = "Standard" + ULTRA_PERFORMANCE = "UltraPerformance" + VPN_GW1 = "VpnGw1" + VPN_GW2 = "VpnGw2" + VPN_GW3 = "VpnGw3" + VPN_GW4 = "VpnGw4" + VPN_GW5 = "VpnGw5" + VPN_GW1_AZ = "VpnGw1AZ" + VPN_GW2_AZ = "VpnGw2AZ" + VPN_GW3_AZ = "VpnGw3AZ" + VPN_GW4_AZ = "VpnGw4AZ" + VPN_GW5_AZ = "VpnGw5AZ" + ER_GW1_AZ = "ErGw1AZ" + ER_GW2_AZ = "ErGw2AZ" + ER_GW3_AZ = "ErGw3AZ" + +class VirtualNetworkGatewaySkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gateway SKU tier. + """ + + BASIC = "Basic" + HIGH_PERFORMANCE = "HighPerformance" + STANDARD = "Standard" + ULTRA_PERFORMANCE = "UltraPerformance" + VPN_GW1 = "VpnGw1" + VPN_GW2 = "VpnGw2" + VPN_GW3 = "VpnGw3" + VPN_GW4 = "VpnGw4" + VPN_GW5 = "VpnGw5" + VPN_GW1_AZ = "VpnGw1AZ" + VPN_GW2_AZ = "VpnGw2AZ" + VPN_GW3_AZ = "VpnGw3AZ" + VPN_GW4_AZ = "VpnGw4AZ" + VPN_GW5_AZ = "VpnGw5AZ" + ER_GW1_AZ = "ErGw1AZ" + ER_GW2_AZ = "ErGw2AZ" + ER_GW3_AZ = "ErGw3AZ" + +class VirtualNetworkGatewayType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of this virtual network gateway. + """ + + VPN = "Vpn" + EXPRESS_ROUTE = "ExpressRoute" + LOCAL_GATEWAY = "LocalGateway" + +class VirtualNetworkPeeringState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the virtual network peering. + """ + + INITIATED = "Initiated" + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + +class VirtualWanSecurityProviderType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The virtual wan security provider type. + """ + + EXTERNAL = "External" + NATIVE = "Native" + +class VpnAuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """VPN authentication types enabled for the VpnServerConfiguration. + """ + + CERTIFICATE = "Certificate" + RADIUS = "Radius" + AAD = "AAD" + +class VpnClientProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """VPN client protocol enabled for the virtual network gateway. + """ + + IKE_V2 = "IkeV2" + SSTP = "SSTP" + OPEN_VPN = "OpenVPN" + +class VpnConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current state of the vpn connection. + """ + + UNKNOWN = "Unknown" + CONNECTING = "Connecting" + CONNECTED = "Connected" + NOT_CONNECTED = "NotConnected" + +class VpnGatewayGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + """ + + NONE = "None" + GENERATION1 = "Generation1" + GENERATION2 = "Generation2" + +class VpnGatewayTunnelingProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """VPN protocol enabled for the VpnServerConfiguration. + """ + + IKE_V2 = "IkeV2" + OPEN_VPN = "OpenVPN" + +class VpnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of this virtual network gateway. + """ + + POLICY_BASED = "PolicyBased" + ROUTE_BASED = "RouteBased" + +class WebApplicationFirewallAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of Actions. + """ + + ALLOW = "Allow" + BLOCK = "Block" + LOG = "Log" + +class WebApplicationFirewallEnabledState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of the policy. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class WebApplicationFirewallMatchVariable(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Match Variable. + """ + + REMOTE_ADDR = "RemoteAddr" + REQUEST_METHOD = "RequestMethod" + QUERY_STRING = "QueryString" + POST_ARGS = "PostArgs" + REQUEST_URI = "RequestUri" + REQUEST_HEADERS = "RequestHeaders" + REQUEST_BODY = "RequestBody" + REQUEST_COOKIES = "RequestCookies" + +class WebApplicationFirewallMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The mode of the policy. + """ + + PREVENTION = "Prevention" + DETECTION = "Detection" + +class WebApplicationFirewallOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operator to be matched. + """ + + IP_MATCH = "IPMatch" + EQUAL = "Equal" + CONTAINS = "Contains" + LESS_THAN = "LessThan" + GREATER_THAN = "GreaterThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + BEGINS_WITH = "BeginsWith" + ENDS_WITH = "EndsWith" + REGEX = "Regex" + GEO_MATCH = "GeoMatch" + +class WebApplicationFirewallPolicyResourceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource status of the policy. + """ + + CREATING = "Creating" + ENABLING = "Enabling" + ENABLED = "Enabled" + DISABLING = "Disabling" + DISABLED = "Disabled" + DELETING = "Deleting" + +class WebApplicationFirewallRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The rule type. + """ + + MATCH_RULE = "MatchRule" + INVALID = "Invalid" + +class WebApplicationFirewallTransform(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Transforms applied before matching. + """ + + LOWERCASE = "Lowercase" + TRIM = "Trim" + URL_DECODE = "UrlDecode" + URL_ENCODE = "UrlEncode" + REMOVE_NULLS = "RemoveNulls" + HTML_ENTITY_DECODE = "HtmlEntityDecode" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/__init__.py new file mode 100644 index 0000000000000..579cf30e3f804 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/__init__.py @@ -0,0 +1,223 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._application_gateways_operations import ApplicationGatewaysOperations +from ._application_gateway_private_link_resources_operations import ApplicationGatewayPrivateLinkResourcesOperations +from ._application_gateway_private_endpoint_connections_operations import ApplicationGatewayPrivateEndpointConnectionsOperations +from ._application_security_groups_operations import ApplicationSecurityGroupsOperations +from ._available_delegations_operations import AvailableDelegationsOperations +from ._available_resource_group_delegations_operations import AvailableResourceGroupDelegationsOperations +from ._available_service_aliases_operations import AvailableServiceAliasesOperations +from ._azure_firewalls_operations import AzureFirewallsOperations +from ._azure_firewall_fqdn_tags_operations import AzureFirewallFqdnTagsOperations +from ._web_categories_operations import WebCategoriesOperations +from ._bastion_hosts_operations import BastionHostsOperations +from ._network_management_client_operations import NetworkManagementClientOperationsMixin +from ._custom_ip_prefixes_operations import CustomIPPrefixesOperations +from ._ddos_custom_policies_operations import DdosCustomPoliciesOperations +from ._ddos_protection_plans_operations import DdosProtectionPlansOperations +from ._dscp_configuration_operations import DscpConfigurationOperations +from ._available_endpoint_services_operations import AvailableEndpointServicesOperations +from ._express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations +from ._express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations +from ._express_route_circuit_connections_operations import ExpressRouteCircuitConnectionsOperations +from ._peer_express_route_circuit_connections_operations import PeerExpressRouteCircuitConnectionsOperations +from ._express_route_circuits_operations import ExpressRouteCircuitsOperations +from ._express_route_service_providers_operations import ExpressRouteServiceProvidersOperations +from ._express_route_cross_connections_operations import ExpressRouteCrossConnectionsOperations +from ._express_route_cross_connection_peerings_operations import ExpressRouteCrossConnectionPeeringsOperations +from ._express_route_ports_locations_operations import ExpressRoutePortsLocationsOperations +from ._express_route_ports_operations import ExpressRoutePortsOperations +from ._express_route_links_operations import ExpressRouteLinksOperations +from ._firewall_policies_operations import FirewallPoliciesOperations +from ._firewall_policy_rule_collection_groups_operations import FirewallPolicyRuleCollectionGroupsOperations +from ._ip_allocations_operations import IpAllocationsOperations +from ._ip_groups_operations import IpGroupsOperations +from ._load_balancers_operations import LoadBalancersOperations +from ._load_balancer_backend_address_pools_operations import LoadBalancerBackendAddressPoolsOperations +from ._load_balancer_frontend_ip_configurations_operations import LoadBalancerFrontendIPConfigurationsOperations +from ._inbound_nat_rules_operations import InboundNatRulesOperations +from ._load_balancer_load_balancing_rules_operations import LoadBalancerLoadBalancingRulesOperations +from ._load_balancer_outbound_rules_operations import LoadBalancerOutboundRulesOperations +from ._load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations +from ._load_balancer_probes_operations import LoadBalancerProbesOperations +from ._nat_gateways_operations import NatGatewaysOperations +from ._network_interfaces_operations import NetworkInterfacesOperations +from ._network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations +from ._network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations +from ._network_interface_tap_configurations_operations import NetworkInterfaceTapConfigurationsOperations +from ._network_profiles_operations import NetworkProfilesOperations +from ._network_security_groups_operations import NetworkSecurityGroupsOperations +from ._security_rules_operations import SecurityRulesOperations +from ._default_security_rules_operations import DefaultSecurityRulesOperations +from ._network_virtual_appliances_operations import NetworkVirtualAppliancesOperations +from ._virtual_appliance_sites_operations import VirtualApplianceSitesOperations +from ._virtual_appliance_skus_operations import VirtualApplianceSkusOperations +from ._inbound_security_rule_operations import InboundSecurityRuleOperations +from ._network_watchers_operations import NetworkWatchersOperations +from ._packet_captures_operations import PacketCapturesOperations +from ._connection_monitors_operations import ConnectionMonitorsOperations +from ._flow_logs_operations import FlowLogsOperations +from ._operations import Operations +from ._private_endpoints_operations import PrivateEndpointsOperations +from ._available_private_endpoint_types_operations import AvailablePrivateEndpointTypesOperations +from ._private_dns_zone_groups_operations import PrivateDnsZoneGroupsOperations +from ._private_link_services_operations import PrivateLinkServicesOperations +from ._public_ip_addresses_operations import PublicIPAddressesOperations +from ._public_ip_prefixes_operations import PublicIPPrefixesOperations +from ._route_filters_operations import RouteFiltersOperations +from ._route_filter_rules_operations import RouteFilterRulesOperations +from ._route_tables_operations import RouteTablesOperations +from ._routes_operations import RoutesOperations +from ._security_partner_providers_operations import SecurityPartnerProvidersOperations +from ._bgp_service_communities_operations import BgpServiceCommunitiesOperations +from ._service_endpoint_policies_operations import ServiceEndpointPoliciesOperations +from ._service_endpoint_policy_definitions_operations import ServiceEndpointPolicyDefinitionsOperations +from ._service_tags_operations import ServiceTagsOperations +from ._usages_operations import UsagesOperations +from ._virtual_networks_operations import VirtualNetworksOperations +from ._subnets_operations import SubnetsOperations +from ._resource_navigation_links_operations import ResourceNavigationLinksOperations +from ._service_association_links_operations import ServiceAssociationLinksOperations +from ._virtual_network_peerings_operations import VirtualNetworkPeeringsOperations +from ._virtual_network_gateways_operations import VirtualNetworkGatewaysOperations +from ._virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations +from ._local_network_gateways_operations import LocalNetworkGatewaysOperations +from ._virtual_network_taps_operations import VirtualNetworkTapsOperations +from ._virtual_routers_operations import VirtualRoutersOperations +from ._virtual_router_peerings_operations import VirtualRouterPeeringsOperations +from ._virtual_wans_operations import VirtualWansOperations +from ._vpn_sites_operations import VpnSitesOperations +from ._vpn_site_links_operations import VpnSiteLinksOperations +from ._vpn_sites_configuration_operations import VpnSitesConfigurationOperations +from ._vpn_server_configurations_operations import VpnServerConfigurationsOperations +from ._virtual_hubs_operations import VirtualHubsOperations +from ._hub_virtual_network_connections_operations import HubVirtualNetworkConnectionsOperations +from ._vpn_gateways_operations import VpnGatewaysOperations +from ._vpn_connections_operations import VpnConnectionsOperations +from ._vpn_site_link_connections_operations import VpnSiteLinkConnectionsOperations +from ._vpn_link_connections_operations import VpnLinkConnectionsOperations +from ._p2_svpn_gateways_operations import P2SVpnGatewaysOperations +from ._vpn_server_configurations_associated_with_virtual_wan_operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from ._virtual_hub_route_table_v2_s_operations import VirtualHubRouteTableV2SOperations +from ._express_route_gateways_operations import ExpressRouteGatewaysOperations +from ._express_route_connections_operations import ExpressRouteConnectionsOperations +from ._virtual_hub_bgp_connection_operations import VirtualHubBgpConnectionOperations +from ._virtual_hub_bgp_connections_operations import VirtualHubBgpConnectionsOperations +from ._virtual_hub_ip_configuration_operations import VirtualHubIpConfigurationOperations +from ._hub_route_tables_operations import HubRouteTablesOperations +from ._web_application_firewall_policies_operations import WebApplicationFirewallPoliciesOperations + +__all__ = [ + 'ApplicationGatewaysOperations', + 'ApplicationGatewayPrivateLinkResourcesOperations', + 'ApplicationGatewayPrivateEndpointConnectionsOperations', + 'ApplicationSecurityGroupsOperations', + 'AvailableDelegationsOperations', + 'AvailableResourceGroupDelegationsOperations', + 'AvailableServiceAliasesOperations', + 'AzureFirewallsOperations', + 'AzureFirewallFqdnTagsOperations', + 'WebCategoriesOperations', + 'BastionHostsOperations', + 'NetworkManagementClientOperationsMixin', + 'CustomIPPrefixesOperations', + 'DdosCustomPoliciesOperations', + 'DdosProtectionPlansOperations', + 'DscpConfigurationOperations', + 'AvailableEndpointServicesOperations', + 'ExpressRouteCircuitAuthorizationsOperations', + 'ExpressRouteCircuitPeeringsOperations', + 'ExpressRouteCircuitConnectionsOperations', + 'PeerExpressRouteCircuitConnectionsOperations', + 'ExpressRouteCircuitsOperations', + 'ExpressRouteServiceProvidersOperations', + 'ExpressRouteCrossConnectionsOperations', + 'ExpressRouteCrossConnectionPeeringsOperations', + 'ExpressRoutePortsLocationsOperations', + 'ExpressRoutePortsOperations', + 'ExpressRouteLinksOperations', + 'FirewallPoliciesOperations', + 'FirewallPolicyRuleCollectionGroupsOperations', + 'IpAllocationsOperations', + 'IpGroupsOperations', + 'LoadBalancersOperations', + 'LoadBalancerBackendAddressPoolsOperations', + 'LoadBalancerFrontendIPConfigurationsOperations', + 'InboundNatRulesOperations', + 'LoadBalancerLoadBalancingRulesOperations', + 'LoadBalancerOutboundRulesOperations', + 'LoadBalancerNetworkInterfacesOperations', + 'LoadBalancerProbesOperations', + 'NatGatewaysOperations', + 'NetworkInterfacesOperations', + 'NetworkInterfaceIPConfigurationsOperations', + 'NetworkInterfaceLoadBalancersOperations', + 'NetworkInterfaceTapConfigurationsOperations', + 'NetworkProfilesOperations', + 'NetworkSecurityGroupsOperations', + 'SecurityRulesOperations', + 'DefaultSecurityRulesOperations', + 'NetworkVirtualAppliancesOperations', + 'VirtualApplianceSitesOperations', + 'VirtualApplianceSkusOperations', + 'InboundSecurityRuleOperations', + 'NetworkWatchersOperations', + 'PacketCapturesOperations', + 'ConnectionMonitorsOperations', + 'FlowLogsOperations', + 'Operations', + 'PrivateEndpointsOperations', + 'AvailablePrivateEndpointTypesOperations', + 'PrivateDnsZoneGroupsOperations', + 'PrivateLinkServicesOperations', + 'PublicIPAddressesOperations', + 'PublicIPPrefixesOperations', + 'RouteFiltersOperations', + 'RouteFilterRulesOperations', + 'RouteTablesOperations', + 'RoutesOperations', + 'SecurityPartnerProvidersOperations', + 'BgpServiceCommunitiesOperations', + 'ServiceEndpointPoliciesOperations', + 'ServiceEndpointPolicyDefinitionsOperations', + 'ServiceTagsOperations', + 'UsagesOperations', + 'VirtualNetworksOperations', + 'SubnetsOperations', + 'ResourceNavigationLinksOperations', + 'ServiceAssociationLinksOperations', + 'VirtualNetworkPeeringsOperations', + 'VirtualNetworkGatewaysOperations', + 'VirtualNetworkGatewayConnectionsOperations', + 'LocalNetworkGatewaysOperations', + 'VirtualNetworkTapsOperations', + 'VirtualRoutersOperations', + 'VirtualRouterPeeringsOperations', + 'VirtualWansOperations', + 'VpnSitesOperations', + 'VpnSiteLinksOperations', + 'VpnSitesConfigurationOperations', + 'VpnServerConfigurationsOperations', + 'VirtualHubsOperations', + 'HubVirtualNetworkConnectionsOperations', + 'VpnGatewaysOperations', + 'VpnConnectionsOperations', + 'VpnSiteLinkConnectionsOperations', + 'VpnLinkConnectionsOperations', + 'P2SVpnGatewaysOperations', + 'VpnServerConfigurationsAssociatedWithVirtualWanOperations', + 'VirtualHubRouteTableV2SOperations', + 'ExpressRouteGatewaysOperations', + 'ExpressRouteConnectionsOperations', + 'VirtualHubBgpConnectionOperations', + 'VirtualHubBgpConnectionsOperations', + 'VirtualHubIpConfigurationOperations', + 'HubRouteTablesOperations', + 'WebApplicationFirewallPoliciesOperations', +] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateway_private_endpoint_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateway_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..07d63341192f7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateway_private_endpoint_connections_operations.py @@ -0,0 +1,439 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationGatewayPrivateEndpointConnectionsOperations(object): + """ApplicationGatewayPrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + connection_name, # type: str + parameters, # type: "_models.ApplicationGatewayPrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ApplicationGatewayPrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayPrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ApplicationGatewayPrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + connection_name, # type: str + parameters, # type: "_models.ApplicationGatewayPrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ApplicationGatewayPrivateEndpointConnection"] + """Updates the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + :type connection_name: str + :param parameters: Parameters supplied to update application gateway private endpoint + connection operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ApplicationGatewayPrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + connection_name=connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGatewayPrivateEndpointConnection" + """Gets the specified private endpoint connection on application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param connection_name: The name of the application gateway private endpoint connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewayPrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] + """Lists all private endpoint connections on an application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayPrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayPrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateway_private_link_resources_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateway_private_link_resources_operations.py new file mode 100644 index 0000000000000..da61413a38008 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateway_private_link_resources_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationGatewayPrivateLinkResourcesOperations(object): + """ApplicationGatewayPrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationGatewayPrivateLinkResourceListResult"] + """Lists all private link resources on an application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayPrivateLinkResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayPrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayPrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayPrivateLinkResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateways_operations.py new file mode 100644 index 0000000000000..9c016e15873b8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_gateways_operations.py @@ -0,0 +1,1413 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationGatewaysOperations(object): + """ApplicationGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGateway" + """Gets the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + parameters, # type: "_models.ApplicationGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ApplicationGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + parameters, # type: "_models.ApplicationGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ApplicationGateway"] + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update application gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ApplicationGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGateway" + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param parameters: Parameters supplied to update application gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] + """Lists all application gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] + """Gets all the application gateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore + + def _stop_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore + + def begin_stop( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Stops the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore + + def _backend_health_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._backend_health_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _backend_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore + + def begin_backend_health( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] + """Gets the backend health of the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._backend_health_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + expand=expand, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore + + def _backend_health_on_demand_initial( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealthOnDemand"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._backend_health_on_demand_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayBackendHealthOnDemand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _backend_health_on_demand_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand'} # type: ignore + + def begin_backend_health_on_demand( + self, + resource_group_name, # type: str + application_gateway_name, # type: str + probe_request, # type: "_models.ApplicationGatewayOnDemandProbe" + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealthOnDemand"] + """Gets the backend health for given combination of backend pool and http setting of the specified + application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param probe_request: Request body for on-demand test probe operation. + :type probe_request: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayOnDemandProbe + :param expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayBackendHealthOnDemand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealthOnDemand"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._backend_health_on_demand_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + probe_request=probe_request, + expand=expand, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayBackendHealthOnDemand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_backend_health_on_demand.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand'} # type: ignore + + def list_available_server_variables( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Lists all available server variables. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_server_variables.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_server_variables.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables'} # type: ignore + + def list_available_request_headers( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Lists all available request headers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_request_headers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_request_headers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders'} # type: ignore + + def list_available_response_headers( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Lists all available response headers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_response_headers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_response_headers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders'} # type: ignore + + def list_available_waf_rule_sets( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" + """Lists all available web application firewall rule sets. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewayAvailableWafRuleSetsResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_waf_rule_sets.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewayAvailableWafRuleSetsResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} # type: ignore + + def list_available_ssl_options( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" + """Lists available Ssl options for configuring Ssl policy. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewayAvailableSslOptions, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAvailableSslOptions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_available_ssl_options.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewayAvailableSslOptions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} # type: ignore + + def list_available_ssl_predefined_policies( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] + """Lists all SSL predefined policies for configuring Ssl policy. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationGatewayAvailableSslPredefinedPolicies or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationGatewayAvailableSslPredefinedPolicies', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} # type: ignore + + def get_ssl_predefined_policy( + self, + predefined_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" + """Gets Ssl predefined policy with the specified policy name. + + :param predefined_policy_name: Name of Ssl predefined policy. + :type predefined_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationGatewaySslPredefinedPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationGatewaySslPredefinedPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_ssl_predefined_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationGatewaySslPredefinedPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_security_groups_operations.py new file mode 100644 index 0000000000000..c0b6b115abb9f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_application_security_groups_operations.py @@ -0,0 +1,553 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ApplicationSecurityGroupsOperations(object): + """ApplicationSecurityGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + application_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + application_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + application_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationSecurityGroup" + """Gets information about the specified application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + application_security_group_name, # type: str + parameters, # type: "_models.ApplicationSecurityGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + application_security_group_name, # type: str + parameters, # type: "_models.ApplicationSecurityGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ApplicationSecurityGroup"] + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update ApplicationSecurityGroup + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + application_security_group_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ApplicationSecurityGroup" + """Updates an application security group's tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application security group. + :type application_security_group_name: str + :param parameters: Parameters supplied to update application security group tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApplicationSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApplicationSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] + """Gets all application security groups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationSecurityGroupListResult"] + """Gets all the application security groups in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_delegations_operations.py new file mode 100644 index 0000000000000..e054113292a09 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_delegations_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableDelegationsOperations(object): + """AvailableDelegationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] + """Gets all of the available subnet delegations for this subscription in this region. + + :param location: The location of the subnet. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableDelegationsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableDelegationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_endpoint_services_operations.py new file mode 100644 index 0000000000000..698a34c67d96a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_endpoint_services_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableEndpointServicesOperations(object): + """AvailableEndpointServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EndpointServicesListResult"] + """List what values of endpoint services are available for use. + + :param location: The location to check available endpoint services. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EndpointServicesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.EndpointServicesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EndpointServicesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_private_endpoint_types_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_private_endpoint_types_operations.py new file mode 100644 index 0000000000000..369a8e66a9f5d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_private_endpoint_types_operations.py @@ -0,0 +1,194 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailablePrivateEndpointTypesOperations(object): + """AvailablePrivateEndpointTypesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailablePrivateEndpointTypesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailablePrivateEndpointTypesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes'} # type: ignore + + def list_by_resource_group( + self, + location, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AvailablePrivateEndpointTypesResult"] + """Returns all of the resource types that can be linked to a Private Endpoint in this subscription + in this region. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailablePrivateEndpointTypesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailablePrivateEndpointTypesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailablePrivateEndpointTypesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_resource_group_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_resource_group_delegations_operations.py new file mode 100644 index 0000000000000..e40effbf3eedf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_resource_group_delegations_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableResourceGroupDelegationsOperations(object): + """AvailableResourceGroupDelegationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AvailableDelegationsResult"] + """Gets all of the available subnet delegations for this resource group in this region. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableDelegationsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableDelegationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableDelegationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_service_aliases_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_service_aliases_operations.py new file mode 100644 index 0000000000000..4c6bc358480f0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_available_service_aliases_operations.py @@ -0,0 +1,192 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AvailableServiceAliasesOperations(object): + """AvailableServiceAliasesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] + """Gets all available service aliases for this subscription in this region. + + :param location: The location. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableServiceAliasesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableServiceAliasesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AvailableServiceAliasesResult"] + """Gets all available service aliases for this resource group in this region. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param location: The location. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableServiceAliasesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableServiceAliasesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AvailableServiceAliasesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_azure_firewall_fqdn_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_azure_firewall_fqdn_tags_operations.py new file mode 100644 index 0000000000000..8ab883cb168fe --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AzureFirewallFqdnTagsOperations(object): + """AzureFirewallFqdnTagsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AzureFirewallFqdnTagListResult"] + """Gets all the Azure Firewall FQDN Tags in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureFirewallFqdnTagListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureFirewallFqdnTagListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallFqdnTagListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AzureFirewallFqdnTagListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_azure_firewalls_operations.py new file mode 100644 index 0000000000000..ff0abeec5e597 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_azure_firewalls_operations.py @@ -0,0 +1,613 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AzureFirewallsOperations(object): + """AzureFirewallsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureFirewall" + """Gets the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureFirewall, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.AzureFirewall + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + parameters, # type: "_models.AzureFirewall" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureFirewall" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AzureFirewall') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + parameters, # type: "_models.AzureFirewall" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AzureFirewall"] + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure Firewall operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.AzureFirewall + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str', max_length=56, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AzureFirewall"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def begin_update_tags( + self, + resource_group_name, # type: str + azure_firewall_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AzureFirewall"] + """Updates tags of an Azure Firewall resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param parameters: Parameters supplied to update azure firewall tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.AzureFirewall] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewall"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AzureFirewall', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AzureFirewallListResult"] + """Lists all Azure Firewalls in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureFirewallListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AzureFirewallListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AzureFirewallListResult"] + """Gets all the Azure Firewalls in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureFirewallListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureFirewallListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AzureFirewallListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_bastion_hosts_operations.py new file mode 100644 index 0000000000000..a1948cc226c2c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_bastion_hosts_operations.py @@ -0,0 +1,485 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BastionHostsOperations(object): + """BastionHostsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Bastion Host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BastionHost" + """Gets the specified Bastion Host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BastionHost, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.BastionHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BastionHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + parameters, # type: "_models.BastionHost" + **kwargs # type: Any + ): + # type: (...) -> "_models.BastionHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BastionHost') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BastionHost', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BastionHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + parameters, # type: "_models.BastionHost" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BastionHost"] + """Creates or updates the specified Bastion Host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param parameters: Parameters supplied to the create or update Bastion Host operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.BastionHost + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.BastionHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHost"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BastionHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BastionHostListResult"] + """Lists all Bastion Hosts in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionHostListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BastionHostListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BastionHostListResult"] + """Lists all Bastion Hosts in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionHostListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionHostListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BastionHostListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_bgp_service_communities_operations.py new file mode 100644 index 0000000000000..14846e2890906 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_bgp_service_communities_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BgpServiceCommunitiesOperations(object): + """BgpServiceCommunitiesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] + """Gets all the available bgp service communities. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BgpServiceCommunityListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BgpServiceCommunityListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BgpServiceCommunityListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_connection_monitors_operations.py new file mode 100644 index 0000000000000..6d9f93a2155e4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_connection_monitors_operations.py @@ -0,0 +1,887 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConnectionMonitorsOperations(object): + """ConnectionMonitorsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + parameters, # type: "_models.ConnectionMonitor" + migrate=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if migrate is not None: + query_parameters['migrate'] = self._serialize.query("migrate", migrate, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectionMonitor') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + parameters, # type: "_models.ConnectionMonitor" + migrate=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConnectionMonitorResult"] + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a connection monitor. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitor + :param migrate: Value indicating whether connection monitor V1 should be migrated to V2 format. + :type migrate: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + parameters=parameters, + migrate=migrate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionMonitorResult" + """Gets a connection monitor by name. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionMonitorResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionMonitorResult" + """Update tags of the specified connection monitor. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :param parameters: Parameters supplied to update connection monitor tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionMonitorResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} # type: ignore + + def _stop_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} # type: ignore + + def begin_stop( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Stops the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts the specified connection monitor. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} # type: ignore + + def _query_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionMonitorQueryResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._query_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _query_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} # type: ignore + + def begin_query( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + connection_monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConnectionMonitorQueryResult"] + """Query a snapshot of the most recent connection states. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name given to the connection monitor. + :type connection_monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorQueryResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorQueryResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._query_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} # type: ignore + + def list( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ConnectionMonitorListResult"] + """Lists all connection monitors for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConnectionMonitorListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ConnectionMonitorListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionMonitorListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConnectionMonitorListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_custom_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_custom_ip_prefixes_operations.py new file mode 100644 index 0000000000000..4f71e536f6412 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_custom_ip_prefixes_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CustomIPPrefixesOperations(object): + """CustomIPPrefixesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + custom_ip_prefix_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + custom_ip_prefix_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified custom IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the CustomIpPrefix. + :type custom_ip_prefix_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + custom_ip_prefix_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomIpPrefix" + """Gets the specified custom IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. + :type custom_ip_prefix_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomIpPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + custom_ip_prefix_name, # type: str + parameters, # type: "_models.CustomIpPrefix" + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomIpPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CustomIpPrefix') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + custom_ip_prefix_name, # type: str + parameters, # type: "_models.CustomIpPrefix" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.CustomIpPrefix"] + """Creates or updates a custom IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update custom IP prefix operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CustomIpPrefix or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + custom_ip_prefix_name=custom_ip_prefix_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + custom_ip_prefix_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomIpPrefix" + """Updates custom IP prefix tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param custom_ip_prefix_name: The name of the custom IP prefix. + :type custom_ip_prefix_name: str + :param parameters: Parameters supplied to update custom IP prefix tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomIpPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'customIpPrefixName': self._serialize.url("custom_ip_prefix_name", custom_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomIpPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CustomIpPrefixListResult"] + """Gets all the custom IP prefixes in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CustomIpPrefixListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CustomIpPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CustomIpPrefixListResult"] + """Gets all custom IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CustomIpPrefixListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomIpPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CustomIpPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ddos_custom_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ddos_custom_policies_operations.py new file mode 100644 index 0000000000000..b4d1bd1470700 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ddos_custom_policies_operations.py @@ -0,0 +1,413 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DdosCustomPoliciesOperations(object): + """DdosCustomPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + ddos_custom_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + ddos_custom_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + ddos_custom_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DdosCustomPolicy" + """Gets information about the specified DDoS custom policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosCustomPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + ddos_custom_policy_name, # type: str + parameters, # type: "_models.DdosCustomPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.DdosCustomPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DdosCustomPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + ddos_custom_policy_name, # type: str + parameters, # type: "_models.DdosCustomPolicy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DdosCustomPolicy"] + """Creates or updates a DDoS custom policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to the create or update operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_custom_policy_name=ddos_custom_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + ddos_custom_policy_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.DdosCustomPolicy" + """Update a DDoS custom policy tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_custom_policy_name: The name of the DDoS custom policy. + :type ddos_custom_policy_name: str + :param parameters: Parameters supplied to update DDoS custom policy resource tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosCustomPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosCustomPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosCustomPolicyName': self._serialize.url("ddos_custom_policy_name", ddos_custom_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosCustomPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ddos_protection_plans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ddos_protection_plans_operations.py new file mode 100644 index 0000000000000..58a3966a4779d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ddos_protection_plans_operations.py @@ -0,0 +1,552 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DdosProtectionPlansOperations(object): + """DdosProtectionPlansOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + ddos_protection_plan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + ddos_protection_plan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + ddos_protection_plan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DdosProtectionPlan" + """Gets information about the specified DDoS protection plan. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosProtectionPlan, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + ddos_protection_plan_name, # type: str + parameters, # type: "_models.DdosProtectionPlan" + **kwargs # type: Any + ): + # type: (...) -> "_models.DdosProtectionPlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DdosProtectionPlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + ddos_protection_plan_name, # type: str + parameters, # type: "_models.DdosProtectionPlan" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DdosProtectionPlan"] + """Creates or updates a DDoS protection plan. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the create or update operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ddos_protection_plan_name=ddos_protection_plan_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + ddos_protection_plan_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.DdosProtectionPlan" + """Update a DDoS protection plan tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ddos_protection_plan_name: The name of the DDoS protection plan. + :type ddos_protection_plan_name: str + :param parameters: Parameters supplied to the update DDoS protection plan resource tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DdosProtectionPlan, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ddosProtectionPlanName': self._serialize.url("ddos_protection_plan_name", ddos_protection_plan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DdosProtectionPlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] + """Gets all DDoS protection plans in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DdosProtectionPlanListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DdosProtectionPlanListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DdosProtectionPlanListResult"] + """Gets all the DDoS protection plans in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DdosProtectionPlanListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DdosProtectionPlanListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DdosProtectionPlanListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_default_security_rules_operations.py new file mode 100644 index 0000000000000..c2563b3095ba8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_default_security_rules_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DefaultSecurityRulesOperations(object): + """DefaultSecurityRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecurityRuleListResult"] + """Gets all default security rules in a network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + default_security_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityRule" + """Get the specified default network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param default_security_rule_name: The name of the default security rule. + :type default_security_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'defaultSecurityRuleName': self._serialize.url("default_security_rule_name", default_security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_dscp_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_dscp_configuration_operations.py new file mode 100644 index 0000000000000..8636f98198e09 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_dscp_configuration_operations.py @@ -0,0 +1,485 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DscpConfigurationOperations(object): + """DscpConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + dscp_configuration_name, # type: str + parameters, # type: "_models.DscpConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.DscpConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DscpConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + dscp_configuration_name, # type: str + parameters, # type: "_models.DscpConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DscpConfiguration"] + """Creates or updates a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. + :type dscp_configuration_name: str + :param parameters: Parameters supplied to the create or update dscp configuration operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.DscpConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DscpConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.DscpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + dscp_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + dscp_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. + :type dscp_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dscp_configuration_name=dscp_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + dscp_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DscpConfiguration" + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dscp_configuration_name: The name of the resource. + :type dscp_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscpConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DscpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dscpConfigurationName': self._serialize.url("dscp_configuration_name", dscp_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DscpConfigurationListResult"] + """Gets a DSCP Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DscpConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscpConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DscpConfigurationListResult"] + """Gets all dscp configurations in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DscpConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DscpConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscpConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_authorizations_operations.py new file mode 100644 index 0000000000000..dc2dffbdfd6b1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_authorizations_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitAuthorizationsOperations(object): + """ExpressRouteCircuitAuthorizationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + authorization_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + circuit_name, # type: str + authorization_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + circuit_name, # type: str + authorization_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + """Gets the specified authorization from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitAuthorization, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + authorization_name, # type: str + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitAuthorization" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + circuit_name, # type: str + authorization_name, # type: str + authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] + """Creates or updates an authorization in the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or update express route + circuit authorization operation. + :type authorization_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitAuthorization] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + circuit_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AuthorizationListResult"] + """Gets all authorizations in an express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AuthorizationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_connections_operations.py new file mode 100644 index 0000000000000..32a4d95fd5af9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_connections_operations.py @@ -0,0 +1,465 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitConnectionsOperations(object): + """ExpressRouteCircuitConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitConnection" + """Gets the specified Express Route Circuit Connection from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + connection_name, # type: str + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + connection_name, # type: str + express_route_circuit_connection_parameters, # type: "_models.ExpressRouteCircuitConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitConnection"] + """Creates or updates a Express Route Circuit Connection in the specified express route circuits. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the express route circuit connection. + :type connection_name: str + :param express_route_circuit_connection_parameters: Parameters supplied to the create or update + express route circuit connection operation. + :type express_route_circuit_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + connection_name=connection_name, + express_route_circuit_connection_parameters=express_route_circuit_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCircuitConnectionListResult"] + """Gets all global reach connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_peerings_operations.py new file mode 100644 index 0000000000000..d258de7fc075b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuit_peerings_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitPeeringsOperations(object): + """ExpressRouteCircuitPeeringsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified peering from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitPeering" + """Gets the specified peering for the express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + peering_parameters, # type: "_models.ExpressRouteCircuitPeering" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update express route circuit + peering operation. + :type peering_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + circuit_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] + """Gets all peerings in a specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitPeeringListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitPeeringListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuits_operations.py new file mode 100644 index 0000000000000..bded69fc8e870 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_circuits_operations.py @@ -0,0 +1,1073 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCircuitsOperations(object): + """ExpressRouteCircuitsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + circuit_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + circuit_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuit" + """Gets information about the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuit, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + parameters, # type: "_models.ExpressRouteCircuit" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuit" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + circuit_name, # type: str + parameters, # type: "_models.ExpressRouteCircuit" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express route circuit operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + circuit_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuit" + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param parameters: Parameters supplied to update express route circuit tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuit, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore + + def _list_arp_table_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_arp_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_arp_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + def begin_list_arp_table( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] + """Gets the currently advertised ARP table associated with the express route circuit in a resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_arp_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + def _list_routes_table_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore + + def begin_list_routes_table( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] + """Gets the currently advertised routes table associated with the express route circuit in a + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_routes_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore + + def _list_routes_table_summary_initial( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_summary_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_summary_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + def begin_list_routes_table_summary( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + """Gets the currently advertised routes table summary associated with the express route circuit in + a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + def get_stats( + self, + resource_group_name, # type: str + circuit_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitStats" + """Gets all the stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitStats, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_stats.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} # type: ignore + + def get_peering_stats( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCircuitStats" + """Gets all stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCircuitStats, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_peering_stats.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] + """Gets all the express route circuits in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] + """Gets all the express route circuits in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_connections_operations.py new file mode 100644 index 0000000000000..4cd3ffc6444cf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_connections_operations.py @@ -0,0 +1,424 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteConnectionsOperations(object): + """ExpressRouteConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + connection_name, # type: str + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + connection_name, # type: str + put_express_route_connection_parameters, # type: "_models.ExpressRouteConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteConnection"] + """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. + :type connection_name: str + :param put_express_route_connection_parameters: Parameters required in an + ExpressRouteConnection PUT operation. + :type put_express_route_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + put_express_route_connection_parameters=put_express_route_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteConnection" + """Gets the specified ExpressRouteConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param connection_name: The name of the ExpressRoute connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a connection to a ExpressRoute circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param connection_name: The name of the connection subresource. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteConnectionList" + """Lists ExpressRouteConnections. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteConnectionList, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteConnectionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteConnectionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteConnectionList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_cross_connection_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_cross_connection_peerings_operations.py new file mode 100644 index 0000000000000..def3afb0d6591 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_cross_connection_peerings_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCrossConnectionPeeringsOperations(object): + """ExpressRouteCrossConnectionPeeringsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionPeeringList"] + """Gets all peerings in a specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCrossConnectionPeeringList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeeringList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeeringList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionPeeringList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified peering from the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + """Gets the specified peering for the ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCrossConnectionPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCrossConnectionPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + peering_parameters, # type: "_models.ExpressRouteCrossConnectionPeering" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionPeering"] + """Creates or updates a peering in the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + ExpressRouteCrossConnection peering operation. + :type peering_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_cross_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_cross_connections_operations.py new file mode 100644 index 0000000000000..3cde47092bbaa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_cross_connections_operations.py @@ -0,0 +1,839 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteCrossConnectionsOperations(object): + """ExpressRouteCrossConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] + """Retrieves all the ExpressRouteCrossConnections in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCrossConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteCrossConnectionListResult"] + """Retrieves all the ExpressRouteCrossConnections in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteCrossConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCrossConnection" + """Gets details about the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group (peering location of the circuit). + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection (service key of the + circuit). + :type cross_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCrossConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + parameters, # type: "_models.ExpressRouteCrossConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCrossConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + parameters, # type: "_models.ExpressRouteCrossConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnection"] + """Update the specified ExpressRouteCrossConnection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param parameters: Parameters supplied to the update express route crossConnection operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + cross_connection_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteCrossConnection" + """Updates an express route cross connection tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the cross connection. + :type cross_connection_name: str + :param cross_connection_parameters: Parameters supplied to update express route cross + connection tags. + :type cross_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteCrossConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteCrossConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'} # type: ignore + + def _list_arp_table_initial( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_arp_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_arp_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + def begin_list_arp_table( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] + """Gets the currently advertised ARP table associated with the express route cross connection in a + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsArpTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_arp_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore + + def _list_routes_table_summary_initial( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_summary_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCrossConnectionsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_summary_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + def begin_list_routes_table_summary( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + """Gets the route table summary associated with the express route cross connection in a resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCrossConnectionsRoutesTableSummaryListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore + + def _list_routes_table_initial( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_routes_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_routes_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore + + def begin_list_routes_table( + self, + resource_group_name, # type: str + cross_connection_name, # type: str + peering_name, # type: str + device_path, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] + """Gets the currently advertised routes table associated with the express route cross connection + in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cross_connection_name: The name of the ExpressRouteCrossConnection. + :type cross_connection_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteCircuitsRoutesTableListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_routes_table_initial( + resource_group_name=resource_group_name, + cross_connection_name=cross_connection_name, + peering_name=peering_name, + device_path=device_path, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'crossConnectionName': self._serialize.url("cross_connection_name", cross_connection_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_gateways_operations.py new file mode 100644 index 0000000000000..efdfe5c310bac --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_gateways_operations.py @@ -0,0 +1,454 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteGatewaysOperations(object): + """ExpressRouteGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteGatewayList" + """Lists ExpressRoute gateways under a given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteGatewayList, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteGatewayList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteGatewayList" + """Lists ExpressRoute gateways in a given resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteGatewayList, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGatewayList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteGatewayList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + put_express_route_gateway_parameters, # type: "_models.ExpressRouteGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRouteGateway"] + """Creates or updates a ExpressRoute gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :param put_express_route_gateway_parameters: Parameters required in an ExpressRoute gateway PUT + operation. + :type put_express_route_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + put_express_route_gateway_parameters=put_express_route_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteGateway" + """Fetches the details of a ExpressRoute gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + express_route_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway + resource can only be deleted when there are no connection subresources. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_gateway_name: The name of the ExpressRoute gateway. + :type express_route_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + express_route_gateway_name=express_route_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRouteGatewayName': self._serialize.url("express_route_gateway_name", express_route_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_links_operations.py new file mode 100644 index 0000000000000..46715567cb500 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_links_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteLinksOperations(object): + """ExpressRouteLinksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + link_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRouteLink" + """Retrieves the specified ExpressRouteLink resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :param link_name: The name of the ExpressRouteLink resource. + :type link_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRouteLink, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRouteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLink"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + 'linkName': self._serialize.url("link_name", link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRouteLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteLinkListResult"] + """Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteLinkListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_ports_locations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_ports_locations_operations.py new file mode 100644 index 0000000000000..a59e4865a1b28 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_ports_locations_operations.py @@ -0,0 +1,171 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRoutePortsLocationsOperations(object): + """ExpressRoutePortsLocationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"] + """Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each + location. Available bandwidths can only be obtained when retrieving a specific peering + location. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRoutePortsLocationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRoutePortsLocationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations'} # type: ignore + + def get( + self, + location_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRoutePortsLocation" + """Retrieves a single ExpressRoutePort peering location, including the list of available + bandwidths available at said peering location. + + :param location_name: Name of the requested ExpressRoutePort peering location. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRoutePortsLocation, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortsLocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortsLocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRoutePortsLocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_ports_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_ports_operations.py new file mode 100644 index 0000000000000..3d9564fcd6a91 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_ports_operations.py @@ -0,0 +1,619 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRoutePortsOperations(object): + """ExpressRoutePortsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRoutePort" + """Retrieves the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. + :type express_route_port_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRoutePort, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + parameters, # type: "_models.ExpressRoutePort" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRoutePort" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ExpressRoutePort') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + parameters, # type: "_models.ExpressRoutePort" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ExpressRoutePort"] + """Creates or updates the specified ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :param parameters: Parameters supplied to the create ExpressRoutePort operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + express_route_port_name=express_route_port_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExpressRoutePort" + """Update ExpressRoutePort tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of the ExpressRoutePort resource. + :type express_route_port_name: str + :param parameters: Parameters supplied to update ExpressRoutePort resource tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressRoutePort, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePort"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExpressRoutePort', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] + """List all the ExpressRoutePort resources in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRoutePortListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRoutePortListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRoutePortListResult"] + """List all the ExpressRoutePort resources in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRoutePortListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRoutePortListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRoutePortListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts'} # type: ignore + + def generate_loa( + self, + resource_group_name, # type: str + express_route_port_name, # type: str + request, # type: "_models.GenerateExpressRoutePortsLOARequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.GenerateExpressRoutePortsLOAResult" + """Generate a letter of authorization for the requested ExpressRoutePort resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param express_route_port_name: The name of ExpressRoutePort. + :type express_route_port_name: str + :param request: Request parameters supplied to generate a letter of authorization. + :type request: ~azure.mgmt.network.v2020_07_01.models.GenerateExpressRoutePortsLOARequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateExpressRoutePortsLOAResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.GenerateExpressRoutePortsLOAResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateExpressRoutePortsLOAResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.generate_loa.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'expressRoutePortName': self._serialize.url("express_route_port_name", express_route_port_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'GenerateExpressRoutePortsLOARequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateExpressRoutePortsLOAResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_loa.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_service_providers_operations.py new file mode 100644 index 0000000000000..348f55c27079d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_express_route_service_providers_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ExpressRouteServiceProvidersOperations(object): + """ExpressRouteServiceProvidersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] + """Gets all the available express route service providers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExpressRouteServiceProviderListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ExpressRouteServiceProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressRouteServiceProviderListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_firewall_policies_operations.py new file mode 100644 index 0000000000000..be4e041a9c390 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_firewall_policies_operations.py @@ -0,0 +1,490 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FirewallPoliciesOperations(object): + """FirewallPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.FirewallPolicy" + """Gets the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FirewallPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + parameters, # type: "_models.FirewallPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.FirewallPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FirewallPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + parameters, # type: "_models.FirewallPolicy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FirewallPolicy"] + """Creates or updates the specified Firewall Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param parameters: Parameters supplied to the create or update Firewall Policy operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.FirewallPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] + """Lists all Firewall Policies in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FirewallPolicyListResult"] + """Gets all the Firewall Policies in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_firewall_policy_rule_collection_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_firewall_policy_rule_collection_groups_operations.py new file mode 100644 index 0000000000000..6b3d469c11ce7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_firewall_policy_rule_collection_groups_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FirewallPolicyRuleCollectionGroupsOperations(object): + """FirewallPolicyRuleCollectionGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + rule_collection_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + rule_collection_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. + :type rule_collection_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + rule_collection_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FirewallPolicyRuleCollectionGroup" + """Gets the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. + :type rule_collection_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FirewallPolicyRuleCollectionGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + rule_collection_group_name, # type: str + parameters, # type: "_models.FirewallPolicyRuleCollectionGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.FirewallPolicyRuleCollectionGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FirewallPolicyRuleCollectionGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + rule_collection_group_name, # type: str + parameters, # type: "_models.FirewallPolicyRuleCollectionGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FirewallPolicyRuleCollectionGroup"] + """Creates or updates the specified FirewallPolicyRuleCollectionGroup. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :param rule_collection_group_name: The name of the FirewallPolicyRuleCollectionGroup. + :type rule_collection_group_name: str + :param parameters: Parameters supplied to the create or update + FirewallPolicyRuleCollectionGroup operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FirewallPolicyRuleCollectionGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + firewall_policy_name=firewall_policy_name, + rule_collection_group_name=rule_collection_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'ruleCollectionGroupName': self._serialize.url("rule_collection_group_name", rule_collection_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + firewall_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FirewallPolicyRuleCollectionGroupListResult"] + """Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param firewall_policy_name: The name of the Firewall Policy. + :type firewall_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FirewallPolicyRuleCollectionGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.FirewallPolicyRuleCollectionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallPolicyRuleCollectionGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'firewallPolicyName': self._serialize.url("firewall_policy_name", firewall_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FirewallPolicyRuleCollectionGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_flow_logs_operations.py new file mode 100644 index 0000000000000..fc2114c82cb1b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_flow_logs_operations.py @@ -0,0 +1,516 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FlowLogsOperations(object): + """FlowLogsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + flow_log_name, # type: str + parameters, # type: "_models.FlowLog" + **kwargs # type: Any + ): + # type: (...) -> "_models.FlowLog" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FlowLog') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FlowLog', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + flow_log_name, # type: str + parameters, # type: "_models.FlowLog" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FlowLog"] + """Create or update a flow log for the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. + :type flow_log_name: str + :param parameters: Parameters that define the create or update flow log resource. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FlowLog + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.FlowLog] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + flow_log_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.FlowLog" + """Update tags of the specified flow log. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log. + :type flow_log_name: str + :param parameters: Parameters supplied to update flow log tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FlowLog, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + flow_log_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FlowLog" + """Gets a flow log resource by name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. + :type flow_log_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FlowLog, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FlowLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + flow_log_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + flow_log_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified flow log resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param flow_log_name: The name of the flow log resource. + :type flow_log_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + flow_log_name=flow_log_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'flowLogName': self._serialize.url("flow_log_name", flow_log_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FlowLogListResult"] + """Lists all flow log resources for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FlowLogListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.FlowLogListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FlowLogListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_hub_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_hub_route_tables_operations.py new file mode 100644 index 0000000000000..5dde886d18afc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_hub_route_tables_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HubRouteTablesOperations(object): + """HubRouteTablesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + route_table_parameters, # type: "_models.HubRouteTable" + **kwargs # type: Any + ): + # type: (...) -> "_models.HubRouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_table_parameters, 'HubRouteTable') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + route_table_parameters, # type: "_models.HubRouteTable" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.HubRouteTable"] + """Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. + :type route_table_name: str + :param route_table_parameters: Parameters supplied to create or update RouteTable. + :type route_table_parameters: ~azure.mgmt.network.v2020_07_01.models.HubRouteTable + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either HubRouteTable or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.HubRouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + route_table_parameters=route_table_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HubRouteTable" + """Retrieves the details of a RouteTable. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HubRouteTable, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.HubRouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubRouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HubRouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a RouteTable. + + :param resource_group_name: The resource group name of the RouteTable. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the RouteTable. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListHubRouteTablesResult"] + """Retrieves the details of all RouteTables. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListHubRouteTablesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListHubRouteTablesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubRouteTablesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListHubRouteTablesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_hub_virtual_network_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_hub_virtual_network_connections_operations.py new file mode 100644 index 0000000000000..d08a0d45afa17 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_hub_virtual_network_connections_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HubVirtualNetworkConnectionsOperations(object): + """HubVirtualNetworkConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + hub_virtual_network_connection_parameters, # type: "_models.HubVirtualNetworkConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HubVirtualNetworkConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hub_virtual_network_connection_parameters, 'HubVirtualNetworkConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + hub_virtual_network_connection_parameters, # type: "_models.HubVirtualNetworkConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.HubVirtualNetworkConnection"] + """Creates a hub virtual network connection if it doesn't exist else updates the existing one. + + :param resource_group_name: The resource group name of the HubVirtualNetworkConnection. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. + :type connection_name: str + :param hub_virtual_network_connection_parameters: Parameters supplied to create or update a hub + virtual network connection. + :type hub_virtual_network_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either HubVirtualNetworkConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + hub_virtual_network_connection_parameters=hub_virtual_network_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the HubVirtualNetworkConnection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HubVirtualNetworkConnection" + """Retrieves the details of a HubVirtualNetworkConnection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HubVirtualNetworkConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.HubVirtualNetworkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubVirtualNetworkConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HubVirtualNetworkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListHubVirtualNetworkConnectionsResult"] + """Retrieves the details of all HubVirtualNetworkConnections. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListHubVirtualNetworkConnectionsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListHubVirtualNetworkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListHubVirtualNetworkConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListHubVirtualNetworkConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_inbound_nat_rules_operations.py new file mode 100644 index 0000000000000..5bc368e15473e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_inbound_nat_rules_operations.py @@ -0,0 +1,446 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class InboundNatRulesOperations(object): + """InboundNatRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.InboundNatRuleListResult"] + """Gets all the inbound nat rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundNatRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.InboundNatRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InboundNatRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + inbound_nat_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + inbound_nat_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + inbound_nat_rule_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.InboundNatRule" + """Gets the specified load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InboundNatRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.InboundNatRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + inbound_nat_rule_name, # type: str + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" + **kwargs # type: Any + ): + # type: (...) -> "_models.InboundNatRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + inbound_nat_rule_name, # type: str + inbound_nat_rule_parameters, # type: "_models.InboundNatRule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.InboundNatRule"] + """Creates or updates a load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound nat + rule operation. + :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2020_07_01.models.InboundNatRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.InboundNatRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + inbound_nat_rule_parameters=inbound_nat_rule_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundNatRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_inbound_security_rule_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_inbound_security_rule_operations.py new file mode 100644 index 0000000000000..e25d36c0a277f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_inbound_security_rule_operations.py @@ -0,0 +1,185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class InboundSecurityRuleOperations(object): + """InboundSecurityRuleOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + rule_collection_name, # type: str + parameters, # type: "_models.InboundSecurityRule" + **kwargs # type: Any + ): + # type: (...) -> "_models.InboundSecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'ruleCollectionName': self._serialize.url("rule_collection_name", rule_collection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'InboundSecurityRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('InboundSecurityRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('InboundSecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + rule_collection_name, # type: str + parameters, # type: "_models.InboundSecurityRule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.InboundSecurityRule"] + """Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param rule_collection_name: The name of security rule collection. + :type rule_collection_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance + Inbound Security Rules operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.InboundSecurityRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either InboundSecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.InboundSecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundSecurityRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + rule_collection_name=rule_collection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('InboundSecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'ruleCollectionName': self._serialize.url("rule_collection_name", rule_collection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ip_allocations_operations.py new file mode 100644 index 0000000000000..8039c8459edb3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ip_allocations_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IpAllocationsOperations(object): + """IpAllocationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + ip_allocation_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + ip_allocation_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified IpAllocation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + ip_allocation_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.IpAllocation" + """Gets the specified IpAllocation by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpAllocation, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + ip_allocation_name, # type: str + parameters, # type: "_models.IpAllocation" + **kwargs # type: Any + ): + # type: (...) -> "_models.IpAllocation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'IpAllocation') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + ip_allocation_name, # type: str + parameters, # type: "_models.IpAllocation" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.IpAllocation"] + """Creates or updates an IpAllocation in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.IpAllocation + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either IpAllocation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.IpAllocation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_allocation_name=ip_allocation_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + ip_allocation_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.IpAllocation" + """Updates a IpAllocation tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_allocation_name: The name of the IpAllocation. + :type ip_allocation_name: str + :param parameters: Parameters supplied to update IpAllocation tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpAllocation, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipAllocationName': self._serialize.url("ip_allocation_name", ip_allocation_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpAllocation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IpAllocationListResult"] + """Gets all IpAllocations in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpAllocationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IpAllocationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IpAllocationListResult"] + """Gets all IpAllocations in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpAllocationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpAllocationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IpAllocationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ip_groups_operations.py new file mode 100644 index 0000000000000..3c6d05e41552c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_ip_groups_operations.py @@ -0,0 +1,564 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IpGroupsOperations(object): + """IpGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + ip_groups_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.IpGroup" + """Gets the specified ipGroups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :param expand: Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced + by the IpGroups resource. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + ip_groups_name, # type: str + parameters, # type: "_models.IpGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.IpGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'IpGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('IpGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + ip_groups_name, # type: str + parameters, # type: "_models.IpGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.IpGroup"] + """Creates or updates an ipGroups in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :param parameters: Parameters supplied to the create or update IpGroups operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.IpGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.IpGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def update_groups( + self, + resource_group_name, # type: str + ip_groups_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.IpGroup" + """Updates tags of an IpGroups resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :param parameters: Parameters supplied to the update ipGroups operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IpGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_groups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IpGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + ip_groups_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + ip_groups_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified ipGroups. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ip_groups_name: The name of the ipGroups. + :type ip_groups_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ip_groups_name=ip_groups_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ipGroupsName': self._serialize.url("ip_groups_name", ip_groups_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IpGroupListResult"] + """Gets all IpGroups in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IpGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IpGroupListResult"] + """Gets all IpGroups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IpGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IpGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_backend_address_pools_operations.py new file mode 100644 index 0000000000000..9c6b5957a6024 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_backend_address_pools_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerBackendAddressPoolsOperations(object): + """LoadBalancerBackendAddressPoolsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] + """Gets all the load balancer backed address pools. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerBackendAddressPoolListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerBackendAddressPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerBackendAddressPoolListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + backend_address_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackendAddressPool" + """Gets load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. + :type backend_address_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackendAddressPool, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.BackendAddressPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + backend_address_pool_name, # type: str + parameters, # type: "_models.BackendAddressPool" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackendAddressPool" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackendAddressPool') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + backend_address_pool_name, # type: str + parameters, # type: "_models.BackendAddressPool" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BackendAddressPool"] + """Creates or updates a load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. + :type backend_address_pool_name: str + :param parameters: Parameters supplied to the create or update load balancer backend address + pool operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.BackendAddressPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BackendAddressPool or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BackendAddressPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + backend_address_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + backend_address_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address pool. + :type backend_address_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + backend_address_pool_name=backend_address_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py new file mode 100644 index 0000000000000..1a4bb634cfcdb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_frontend_ip_configurations_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerFrontendIPConfigurationsOperations(object): + """LoadBalancerFrontendIPConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] + """Gets all the load balancer frontend IP configurations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerFrontendIPConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerFrontendIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerFrontendIPConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + frontend_ip_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FrontendIPConfiguration" + """Gets load balancer frontend IP configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param frontend_ip_configuration_name: The name of the frontend IP configuration. + :type frontend_ip_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FrontendIPConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.FrontendIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'frontendIPConfigurationName': self._serialize.url("frontend_ip_configuration_name", frontend_ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FrontendIPConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_load_balancing_rules_operations.py new file mode 100644 index 0000000000000..16d26dd68dd29 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_load_balancing_rules_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerLoadBalancingRulesOperations(object): + """LoadBalancerLoadBalancingRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] + """Gets all the load balancing rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerLoadBalancingRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerLoadBalancingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerLoadBalancingRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + load_balancing_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.LoadBalancingRule" + """Gets the specified load balancer load balancing rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param load_balancing_rule_name: The name of the load balancing rule. + :type load_balancing_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LoadBalancingRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LoadBalancingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'loadBalancingRuleName': self._serialize.url("load_balancing_rule_name", load_balancing_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LoadBalancingRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_network_interfaces_operations.py new file mode 100644 index 0000000000000..5afcb1ac3edcc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_network_interfaces_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerNetworkInterfacesOperations(object): + """LoadBalancerNetworkInterfacesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] + """Gets associated load balancer network interfaces. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_outbound_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_outbound_rules_operations.py new file mode 100644 index 0000000000000..638c9a43f59ed --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_outbound_rules_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerOutboundRulesOperations(object): + """LoadBalancerOutboundRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] + """Gets all the outbound rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerOutboundRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerOutboundRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerOutboundRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + outbound_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OutboundRule" + """Gets the specified load balancer outbound rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param outbound_rule_name: The name of the outbound rule. + :type outbound_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OutboundRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.OutboundRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'outboundRuleName': self._serialize.url("outbound_rule_name", outbound_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OutboundRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_probes_operations.py new file mode 100644 index 0000000000000..245406e6af285 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancer_probes_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancerProbesOperations(object): + """LoadBalancerProbesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] + """Gets all the load balancer probes. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerProbeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerProbeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerProbeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + probe_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Probe" + """Gets load balancer probe. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param probe_name: The name of the probe. + :type probe_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Probe, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Probe + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'probeName': self._serialize.url("probe_name", probe_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Probe', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancers_operations.py new file mode 100644 index 0000000000000..1c9fd59db9c22 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_load_balancers_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LoadBalancersOperations(object): + """LoadBalancersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.LoadBalancer" + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LoadBalancer, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + parameters, # type: "_models.LoadBalancer" + **kwargs # type: Any + ): + # type: (...) -> "_models.LoadBalancer" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LoadBalancer') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + parameters, # type: "_models.LoadBalancer" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.LoadBalancer"] + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load balancer operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.LoadBalancer + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + load_balancer_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.LoadBalancer" + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param parameters: Parameters supplied to update load balancer tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LoadBalancer, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LoadBalancer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerListResult"] + """Gets all the load balancers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LoadBalancerListResult"] + """Gets all the load balancers in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_local_network_gateways_operations.py new file mode 100644 index 0000000000000..7fb19921b61bc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_local_network_gateways_operations.py @@ -0,0 +1,485 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LocalNetworkGatewaysOperations(object): + """LocalNetworkGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + local_network_gateway_name, # type: str + parameters, # type: "_models.LocalNetworkGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.LocalNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LocalNetworkGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + local_network_gateway_name, # type: str + parameters, # type: "_models.LocalNetworkGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.LocalNetworkGateway"] + """Creates or updates a local network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local network gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + local_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.LocalNetworkGateway" + """Gets the specified local network gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LocalNetworkGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + local_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + local_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified local network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + local_network_gateway_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.LocalNetworkGateway" + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network gateway. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to update local network gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LocalNetworkGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] + """Gets all the local network gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LocalNetworkGatewayListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.LocalNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LocalNetworkGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_nat_gateways_operations.py new file mode 100644 index 0000000000000..c7263348c9f6e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_nat_gateways_operations.py @@ -0,0 +1,558 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NatGatewaysOperations(object): + """NatGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + nat_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + nat_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified nat gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + nat_gateway_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NatGateway" + """Gets the specified nat gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NatGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + nat_gateway_name, # type: str + parameters, # type: "_models.NatGateway" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NatGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NatGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NatGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NatGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + nat_gateway_name, # type: str + parameters, # type: "_models.NatGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NatGateway"] + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NatGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NatGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + nat_gateway_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NatGateway" + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param parameters: Parameters supplied to update nat gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NatGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NatGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NatGatewayListResult"] + """Gets all the Nat Gateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NatGatewayListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NatGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NatGatewayListResult"] + """Gets all nat gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NatGatewayListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NatGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_ip_configurations_operations.py new file mode 100644 index 0000000000000..eb28dd94accb7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_ip_configurations_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfaceIPConfigurationsOperations(object): + """NetworkInterfaceIPConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] + """Get all ip configurations in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceIPConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceIPConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_interface_name, # type: str + ip_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" + """Gets the specified network interface ip configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration name. + :type ip_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterfaceIPConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterfaceIPConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_load_balancers_operations.py new file mode 100644 index 0000000000000..b848e86e646bc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_load_balancers_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfaceLoadBalancersOperations(object): + """NetworkInterfaceLoadBalancersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] + """List all load balancers in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceLoadBalancerListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceLoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceLoadBalancerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_tap_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_tap_configurations_operations.py new file mode 100644 index 0000000000000..e23c706cff712 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interface_tap_configurations_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfaceTapConfigurationsOperations(object): + """NetworkInterfaceTapConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_interface_name, # type: str + tap_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_interface_name, # type: str + tap_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified tap configuration from the NetworkInterface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. + :type tap_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_interface_name, # type: str + tap_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + """Get the specified tap configuration on a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. + :type tap_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterfaceTapConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_interface_name, # type: str + tap_configuration_name, # type: str + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterfaceTapConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_interface_name, # type: str + tap_configuration_name, # type: str + tap_configuration_parameters, # type: "_models.NetworkInterfaceTapConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkInterfaceTapConfiguration"] + """Creates or updates a Tap configuration in the specified NetworkInterface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tap_configuration_name: The name of the tap configuration. + :type tap_configuration_name: str + :param tap_configuration_parameters: Parameters supplied to the create or update tap + configuration operation. + :type tap_configuration_parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tap_configuration_name=tap_configuration_name, + tap_configuration_parameters=tap_configuration_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceTapConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'tapConfigurationName': self._serialize.url("tap_configuration_name", tap_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceTapConfigurationListResult"] + """Get all Tap configurations in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceTapConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceTapConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceTapConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceTapConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interfaces_operations.py new file mode 100644 index 0000000000000..d91f6723efa17 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_interfaces_operations.py @@ -0,0 +1,1184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkInterfacesOperations(object): + """NetworkInterfacesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_interface_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterface" + """Gets information about the specified network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterface, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_interface_name, # type: str + parameters, # type: "_models.NetworkInterface" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterface" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkInterface') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_interface_name, # type: str + parameters, # type: "_models.NetworkInterface" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkInterface"] + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network interface operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_interface_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterface" + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param parameters: Parameters supplied to update network interface tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterface, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] + """Gets all network interfaces in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] + """Gets all network interfaces in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} # type: ignore + + def _get_effective_route_table_initial( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_effective_route_table_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_effective_route_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore + + def begin_get_effective_route_table( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] + """Gets all route tables applied to a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.EffectiveRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_effective_route_table_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore + + def _list_effective_network_security_groups_initial( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_effective_network_security_groups_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_effective_network_security_groups_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore + + def begin_list_effective_network_security_groups( + self, + resource_group_name, # type: str + network_interface_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] + """Gets all network security groups applied to a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.EffectiveNetworkSecurityGroupListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_effective_network_security_groups_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore + + def list_virtual_machine_scale_set_vm_network_interfaces( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + virtualmachine_index, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] + """Gets information about all network interfaces in a virtual machine in a virtual machine scale + set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} # type: ignore + + def list_virtual_machine_scale_set_network_interfaces( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] + """Gets all network interfaces in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} # type: ignore + + def get_virtual_machine_scale_set_network_interface( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + virtualmachine_index, # type: str + network_interface_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterface" + """Get the specified network interface in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterface, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + # Construct URL + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterface', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} # type: ignore + + def list_virtual_machine_scale_set_ip_configurations( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + virtualmachine_index, # type: str + network_interface_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkInterfaceIPConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkInterfaceIPConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_ip_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'} # type: ignore + + def get_virtual_machine_scale_set_ip_configuration( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + virtualmachine_index, # type: str + network_interface_name, # type: str + ip_configuration_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkInterfaceIPConfiguration" + """Get the specified network interface ip configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration. + :type ip_configuration_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkInterfaceIPConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + # Construct URL + url = self.get_virtual_machine_scale_set_ip_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkInterfaceIPConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_virtual_machine_scale_set_ip_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_management_client_operations.py new file mode 100644 index 0000000000000..9c09ef1d521be --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_management_client_operations.py @@ -0,0 +1,933 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkManagementClientOperationsMixin(object): + + def _put_bastion_shareable_link_initial( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + bsl_request, # type: "_models.BastionShareableLinkListRequest" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionShareableLinkListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._put_bastion_shareable_link_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_bastion_shareable_link_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks'} # type: ignore + + def begin_put_bastion_shareable_link( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + bsl_request, # type: "_models.BastionShareableLinkListRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]] + """Creates a Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param bsl_request: Post request for all the Bastion Shareable Link endpoints. + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.put_bastion_shareable_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_bastion_shareable_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks'} # type: ignore + + def _delete_bastion_shareable_link_initial( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + bsl_request, # type: "_models.BastionShareableLinkListRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._delete_bastion_shareable_link_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_bastion_shareable_link_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks'} # type: ignore + + def begin_delete_bastion_shareable_link( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + bsl_request, # type: "_models.BastionShareableLinkListRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param bsl_request: Post request for all the Bastion Shareable Link endpoints. + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_bastion_shareable_link_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + bsl_request=bsl_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_bastion_shareable_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks'} # type: ignore + + def get_bastion_shareable_link( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + bsl_request, # type: "_models.BastionShareableLinkListRequest" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BastionShareableLinkListResult"] + """Return the Bastion Shareable Links for all the VMs specified in the request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param bsl_request: Post request for all the Bastion Shareable Link endpoints. + :type bsl_request: ~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionShareableLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionShareableLinkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_bastion_shareable_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_bastion_shareable_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks'} # type: ignore + + def _get_active_sessions_initial( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BastionActiveSessionListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_active_sessions_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_active_sessions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions'} # type: ignore + + def begin_get_active_sessions( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]] + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionActiveSessionListResult]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_active_sessions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionActiveSessionListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_active_sessions_initial( + resource_group_name=resource_group_name, + bastion_host_name=bastion_host_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_active_sessions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions'} # type: ignore + + def disconnect_active_sessions( + self, + resource_group_name, # type: str + bastion_host_name, # type: str + session_ids, # type: "_models.SessionIds" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BastionSessionDeleteResult"] + """Returns the list of currently active sessions on the Bastion. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param bastion_host_name: The name of the Bastion Host. + :type bastion_host_name: str + :param session_ids: The list of sessionids to disconnect. + :type session_ids: ~azure.mgmt.network.v2020_07_01.models.SessionIds + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.BastionSessionDeleteResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BastionSessionDeleteResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.disconnect_active_sessions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'bastionHostName': self._serialize.url("bastion_host_name", bastion_host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(session_ids, 'SessionIds') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(session_ids, 'SessionIds') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BastionSessionDeleteResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + disconnect_active_sessions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions'} # type: ignore + + def check_dns_name_availability( + self, + location, # type: str + domain_name_label, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DnsNameAvailabilityResult" + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + + :param location: The location of the domain name. + :type location: str + :param domain_name_label: The domain name to be verified. It must conform to the following + regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + :type domain_name_label: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DnsNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.DnsNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.check_dns_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DnsNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} # type: ignore + + def supported_security_providers( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualWanSecurityProviders" + """Gives the supported security providers for the virtual wan. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which supported security providers are + needed. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualWanSecurityProviders, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWanSecurityProviders + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWanSecurityProviders"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.supported_security_providers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualWanSecurityProviders', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + supported_security_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders'} # type: ignore + + def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generatevirtualwanvpnserverconfigurationvpnprofile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generatevirtualwanvpnserverconfigurationvpnprofile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile'} # type: ignore + + def begin_generatevirtualwanvpnserverconfigurationvpnprofile( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnProfileResponse"] + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. + :type virtual_wan_name: str + :param vpn_client_params: Parameters supplied to the generate VirtualWan VPN profile generation + operation. + :type vpn_client_params: ~azure.mgmt.network.v2020_07_01.models.VirtualWanVpnProfileParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._generatevirtualwanvpnserverconfigurationvpnprofile_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + vpn_client_params=vpn_client_params, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generatevirtualwanvpnserverconfigurationvpnprofile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_profiles_operations.py new file mode 100644 index 0000000000000..5621c2c13f0a8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_profiles_operations.py @@ -0,0 +1,498 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkProfilesOperations(object): + """NetworkProfilesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network profile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the NetworkProfile. + :type network_profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_profile_name=network_profile_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_profile_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkProfile" + """Gets the specified network profile in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the public IP prefix. + :type network_profile_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + network_profile_name, # type: str + parameters, # type: "_models.NetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkProfile" + """Creates or updates a network profile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. + :type network_profile_name: str + :param parameters: Parameters supplied to the create or update network profile operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_profile_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkProfile" + """Updates network profile tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_profile_name: The name of the network profile. + :type network_profile_name: str + :param parameters: Parameters supplied to update network profile tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkProfile, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkProfileName': self._serialize.url("network_profile_name", network_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkProfileListResult"] + """Gets all the network profiles in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkProfileListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkProfileListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkProfileListResult"] + """Gets all network profiles in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkProfileListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkProfileListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkProfileListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_security_groups_operations.py new file mode 100644 index 0000000000000..ada6551b74916 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_security_groups_operations.py @@ -0,0 +1,558 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkSecurityGroupsOperations(object): + """NetworkSecurityGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSecurityGroup" + """Gets the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + parameters, # type: "_models.NetworkSecurityGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSecurityGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + parameters, # type: "_models.NetworkSecurityGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] + """Creates or updates a network security group in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network security group + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkSecurityGroup" + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param parameters: Parameters supplied to update network security group tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkSecurityGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] + """Gets all network security groups in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] + """Gets all network security groups in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_virtual_appliances_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_virtual_appliances_operations.py new file mode 100644 index 0000000000000..25b2480611129 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_virtual_appliances_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkVirtualAppliancesOperations(object): + """NetworkVirtualAppliancesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. + :type network_virtual_appliance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkVirtualAppliance" + """Gets the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkVirtualAppliance, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkVirtualAppliance" + """Updates a Network Virtual Appliance. + + :param resource_group_name: The resource group name of Network Virtual Appliance. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance being updated. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to Update Network Virtual Appliance Tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkVirtualAppliance, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + parameters, # type: "_models.NetworkVirtualAppliance" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkVirtualAppliance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + parameters, # type: "_models.NetworkVirtualAppliance" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkVirtualAppliance"] + """Creates or updates the specified Network Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualAppliance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualAppliance"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkVirtualAppliance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] + """Lists all Network Virtual Appliances in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkVirtualApplianceListResult"] + """Gets all Network Virtual Appliances in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_watchers_operations.py new file mode 100644 index 0000000000000..0b401356c2758 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_network_watchers_operations.py @@ -0,0 +1,2017 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NetworkWatchersOperations(object): + """NetworkWatchersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.NetworkWatcher" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkWatcher" + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher resource. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkWatcher, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkWatcher') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkWatcher" + """Gets the specified network watcher by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkWatcher, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network watcher resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkWatcher" + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters supplied to update network watcher tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkWatcher, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkWatcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] + """Gets all network watchers by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkWatcherListResult"] + """Gets all network watchers by subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} # type: ignore + + def get_topology( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.TopologyParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.Topology" + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of topology. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TopologyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Topology, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Topology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.get_topology.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TopologyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Topology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} # type: ignore + + def _verify_ip_flow_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.VerificationIPFlowParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.VerificationIPFlowResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._verify_ip_flow_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _verify_ip_flow_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore + + def begin_verify_ip_flow( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.VerificationIPFlowParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] + """Verify IP flow from the specified VM to a location given the currently configured NSG rules. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VerificationIPFlowParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VerificationIPFlowResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._verify_ip_flow_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore + + def _get_next_hop_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.NextHopParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.NextHopResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_next_hop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NextHopParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NextHopResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('NextHopResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_next_hop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore + + def begin_get_next_hop( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.NextHopParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NextHopResult"] + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination endpoint. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NextHopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NextHopResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_next_hop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NextHopResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore + + def _get_vm_security_rules_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.SecurityGroupViewParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityGroupViewResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_vm_security_rules_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vm_security_rules_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore + + def begin_get_vm_security_rules( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.SecurityGroupViewParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] + """Gets the configured and effective security group rules on the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the VM to check security groups for. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.SecurityGroupViewParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.SecurityGroupViewResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_vm_security_rules_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore + + def _get_troubleshooting_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.TroubleshootingParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_troubleshooting_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TroubleshootingParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_troubleshooting_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore + + def begin_get_troubleshooting( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.TroubleshootingParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.TroubleshootingResult"] + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to troubleshoot. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TroubleshootingParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_troubleshooting_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore + + def _get_troubleshooting_result_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.QueryTroubleshootingParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.TroubleshootingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_troubleshooting_result_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_troubleshooting_result_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore + + def begin_get_troubleshooting_result( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.QueryTroubleshootingParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.TroubleshootingResult"] + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to query the troubleshooting result. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.QueryTroubleshootingParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.TroubleshootingResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_troubleshooting_result_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('TroubleshootingResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore + + def _set_flow_log_configuration_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.FlowLogInformation" + **kwargs # type: Any + ): + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._set_flow_log_configuration_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FlowLogInformation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _set_flow_log_configuration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore + + def begin_set_flow_log_configuration( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.FlowLogInformation" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FlowLogInformation"] + """Configures flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow log. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FlowLogInformation + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._set_flow_log_configuration_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore + + def _get_flow_log_status_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.FlowLogStatusParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.FlowLogInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_flow_log_status_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_flow_log_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore + + def begin_get_flow_log_status( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.FlowLogStatusParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FlowLogInformation"] + """Queries status of flow log and traffic analytics (optional) on a specified resource. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define a resource to query flow log and traffic analytics + (optional) status. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.FlowLogStatusParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.FlowLogInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_flow_log_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FlowLogInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore + + def _check_connectivity_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.ConnectivityParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectivityInformation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._check_connectivity_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectivityParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectivityInformation', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ConnectivityInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _check_connectivity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore + + def begin_check_connectivity( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.ConnectivityParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConnectivityInformation"] + """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a + given endpoint including another VM or an arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that determine how the connectivity check will be performed. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectivityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectivityInformation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._check_connectivity_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectivityInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore + + def _get_azure_reachability_report_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.AzureReachabilityReportParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureReachabilityReport" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_azure_reachability_report_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_azure_reachability_report_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} # type: ignore + + def begin_get_azure_reachability_report( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.AzureReachabilityReportParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AzureReachabilityReport"] + """NOTE: This feature is currently in preview and still being tested for stability. Gets the + relative latency score for internet service providers from a specified location to Azure + regions. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report configuration. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReportParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.AzureReachabilityReport] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureReachabilityReport"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_azure_reachability_report_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_azure_reachability_report.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} # type: ignore + + def _list_available_providers_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.AvailableProvidersListParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AvailableProvidersList" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._list_available_providers_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AvailableProvidersList', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AvailableProvidersList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_available_providers_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} # type: ignore + + def begin_list_available_providers( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.AvailableProvidersListParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AvailableProvidersList"] + """NOTE: This feature is currently in preview and still being tested for stability. Lists all + available internet service providers for a specified Azure region. + + :param resource_group_name: The name of the network watcher resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available providers. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.AvailableProvidersListParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.AvailableProvidersList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableProvidersList"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_available_providers_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AvailableProvidersList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} # type: ignore + + def _get_network_configuration_diagnostic_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkConfigurationDiagnosticResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_network_configuration_diagnostic_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_network_configuration_diagnostic_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'} # type: ignore + + def begin_get_network_configuration_diagnostic( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + parameters, # type: "_models.NetworkConfigurationDiagnosticParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkConfigurationDiagnosticResponse"] + """Gets Network Configuration Diagnostic data to help customers understand and debug network + behavior. It provides detailed information on what security rules were applied to a specified + traffic flow and the result of evaluating these rules. Customers must provide details of a flow + like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, + the rules evaluated for the specified flow and the evaluation results. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters to get network configuration diagnostic. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.NetworkConfigurationDiagnosticResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkConfigurationDiagnosticResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_network_configuration_diagnostic_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_network_configuration_diagnostic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_operations.py new file mode 100644 index 0000000000000..f7a4b2ab5311d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available Network Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Network/operations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_p2_svpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_p2_svpn_gateways_operations.py new file mode 100644 index 0000000000000..551a8b107bba1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_p2_svpn_gateways_operations.py @@ -0,0 +1,1231 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class P2SVpnGatewaysOperations(object): + """P2SVpnGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.P2SVpnGateway" + """Retrieves the details of a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: P2SVpnGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.P2SVpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gateway_name, # type: str + p2_s_vpn_gateway_parameters, # type: "_models.P2SVpnGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.P2SVpnGateway"] + """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan p2s + vpn gateway. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def begin_update_tags( + self, + resource_group_name, # type: str + gateway_name, # type: str + p2_s_vpn_gateway_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.P2SVpnGateway"] + """Updates virtual wan p2s vpn gateway tags. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param p2_s_vpn_gateway_parameters: Parameters supplied to update a virtual wan p2s vpn gateway + tags. + :type p2_s_vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + p2_s_vpn_gateway_parameters=p2_s_vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a virtual wan p2s vpn gateway. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] + """Lists all the P2SVpnGateways in a resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListP2SVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListP2SVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListP2SVpnGatewaysResult"] + """Lists all the P2SVpnGateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListP2SVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListP2SVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListP2SVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways'} # type: ignore + + def _reset_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset'} # type: ignore + + def begin_reset( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.P2SVpnGateway"] + """Resets the primary of the p2s vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the P2SVpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset'} # type: ignore + + def _generate_vpn_profile_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + parameters, # type: "_models.P2SVpnProfileParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnProfileResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generate_vpn_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generate_vpn_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile'} # type: ignore + + def begin_generate_vpn_profile( + self, + resource_group_name, # type: str + gateway_name, # type: str + parameters, # type: "_models.P2SVpnProfileParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnProfileResponse"] + """Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. + :type gateway_name: str + :param parameters: Parameters supplied to the generate P2SVpnGateway VPN client package + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.P2SVpnProfileParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnProfileResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnProfileResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnProfileResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile'} # type: ignore + + def _get_p2_s_vpn_connection_health_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_p2_s_vpn_connection_health_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_p2_s_vpn_connection_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth'} # type: ignore + + def begin_get_p2_s_vpn_connection_health( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.P2SVpnGateway"] + """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_p2_s_vpn_connection_health_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_p2_s_vpn_connection_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth'} # type: ignore + + def _get_p2_s_vpn_connection_health_detailed_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + request, # type: "_models.P2SVpnConnectionHealthRequest" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.P2SVpnConnectionHealth"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_p2_s_vpn_connection_health_detailed_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('P2SVpnConnectionHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_p2_s_vpn_connection_health_detailed_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed'} # type: ignore + + def begin_get_p2_s_vpn_connection_health_detailed( + self, + resource_group_name, # type: str + gateway_name, # type: str + request, # type: "_models.P2SVpnConnectionHealthRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.P2SVpnConnectionHealth"] + """Gets the sas url to get the connection health detail of P2S clients of the virtual wan + P2SVpnGateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the P2SVpnGateway. + :type gateway_name: str + :param request: Request parameters supplied to get p2s vpn connections detailed health. + :type request: ~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionHealthRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionHealth] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.P2SVpnConnectionHealth"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_p2_s_vpn_connection_health_detailed_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('P2SVpnConnectionHealth', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_p2_s_vpn_connection_health_detailed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed'} # type: ignore + + def _disconnect_p2_s_vpn_connections_initial( + self, + resource_group_name, # type: str + p2_s_vpn_gateway_name, # type: str + request, # type: "_models.P2SVpnConnectionRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._disconnect_p2_s_vpn_connections_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _disconnect_p2_s_vpn_connections_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections'} # type: ignore + + def begin_disconnect_p2_s_vpn_connections( + self, + resource_group_name, # type: str + p2_s_vpn_gateway_name, # type: str + request, # type: "_models.P2SVpnConnectionRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param p2_s_vpn_gateway_name: The name of the P2S Vpn Gateway. + :type p2_s_vpn_gateway_name: str + :param request: The parameters are supplied to disconnect p2s vpn connections. + :type request: ~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._disconnect_p2_s_vpn_connections_initial( + resource_group_name=resource_group_name, + p2_s_vpn_gateway_name=p2_s_vpn_gateway_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'p2sVpnGatewayName': self._serialize.url("p2_s_vpn_gateway_name", p2_s_vpn_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disconnect_p2_s_vpn_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_packet_captures_operations.py new file mode 100644 index 0000000000000..fbbe28e1da159 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_packet_captures_operations.py @@ -0,0 +1,686 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PacketCapturesOperations(object): + """PacketCapturesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + parameters, # type: "_models.PacketCapture" + **kwargs # type: Any + ): + # type: (...) -> "_models.PacketCaptureResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PacketCapture') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PacketCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + parameters, # type: "_models.PacketCapture" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PacketCaptureResult"] + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PacketCapture + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PacketCaptureResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PacketCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PacketCaptureResult" + """Gets a packet capture session by name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PacketCaptureResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PacketCaptureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PacketCaptureResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore + + def _stop_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore + + def begin_stop( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Stops a specified packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore + + def _get_status_initial( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PacketCaptureQueryStatusResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_status_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore + + def begin_get_status( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + packet_capture_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] + """Query the status of a running packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param packet_capture_name: The name given to the packet capture session. + :type packet_capture_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PacketCaptureQueryStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore + + def list( + self, + resource_group_name, # type: str + network_watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PacketCaptureListResult"] + """Lists all packet capture sessions within the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PacketCaptureListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PacketCaptureListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PacketCaptureListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_peer_express_route_circuit_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_peer_express_route_circuit_connections_operations.py new file mode 100644 index 0000000000000..6b8fea113b653 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_peer_express_route_circuit_connections_operations.py @@ -0,0 +1,194 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PeerExpressRouteCircuitConnectionsOperations(object): + """PeerExpressRouteCircuitConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PeerExpressRouteCircuitConnection" + """Gets the specified Peer Express Route Circuit Connection from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param connection_name: The name of the peer express route circuit connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PeerExpressRouteCircuitConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PeerExpressRouteCircuitConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + circuit_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PeerExpressRouteCircuitConnectionListResult"] + """Gets all global reach peer connections associated with a private peering in an express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PeerExpressRouteCircuitConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PeerExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerExpressRouteCircuitConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PeerExpressRouteCircuitConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_dns_zone_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_dns_zone_groups_operations.py new file mode 100644 index 0000000000000..40bf8ac7d4195 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_dns_zone_groups_operations.py @@ -0,0 +1,442 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateDnsZoneGroupsOperations(object): + """PrivateDnsZoneGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + private_dns_zone_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + private_dns_zone_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified private dns zone group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. + :type private_dns_zone_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + private_dns_zone_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateDnsZoneGroup" + """Gets the private dns zone group resource by specified private dns zone group name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. + :type private_dns_zone_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateDnsZoneGroup, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + private_dns_zone_group_name, # type: str + parameters, # type: "_models.PrivateDnsZoneGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateDnsZoneGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateDnsZoneGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + private_dns_zone_group_name, # type: str + parameters, # type: "_models.PrivateDnsZoneGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateDnsZoneGroup"] + """Creates or updates a private dns zone group in the specified private endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param private_dns_zone_group_name: The name of the private dns zone group. + :type private_dns_zone_group_name: str + :param parameters: Parameters supplied to the create or update private dns zone group + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + private_dns_zone_group_name=private_dns_zone_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateDnsZoneGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'privateDnsZoneGroupName': self._serialize.url("private_dns_zone_group_name", private_dns_zone_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}'} # type: ignore + + def list( + self, + private_endpoint_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateDnsZoneGroupListResult"] + """Gets all private dns zone groups in a private endpoint. + + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateDnsZoneGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateDnsZoneGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateDnsZoneGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateDnsZoneGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_endpoints_operations.py new file mode 100644 index 0000000000000..e2cb1d73adf82 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_endpoints_operations.py @@ -0,0 +1,495 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointsOperations(object): + """PrivateEndpointsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified private endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpoint" + """Gets the specified private endpoint by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpoint, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + parameters, # type: "_models.PrivateEndpoint" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpoint" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpoint') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + private_endpoint_name, # type: str + parameters, # type: "_models.PrivateEndpoint" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpoint"] + """Creates or updates an private endpoint in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param private_endpoint_name: The name of the private endpoint. + :type private_endpoint_name: str + :param parameters: Parameters supplied to the create or update private endpoint operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpoint"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateEndpointName': self._serialize.url("private_endpoint_name", private_endpoint_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] + """Gets all private endpoints in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointListResult"] + """Gets all private endpoints in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_link_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_link_services_operations.py new file mode 100644 index 0000000000000..f19401118fe7e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_private_link_services_operations.py @@ -0,0 +1,1229 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkServicesOperations(object): + """PrivateLinkServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified private link service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + service_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkService" + """Gets the specified private link service by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkService, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateLinkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + service_name, # type: str + parameters, # type: "_models.PrivateLinkService" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateLinkService') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + service_name, # type: str + parameters, # type: "_models.PrivateLinkService" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateLinkService"] + """Creates or updates an private link service in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param parameters: Parameters supplied to the create or update private link service operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateLinkService + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateLinkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateLinkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] + """Gets all private link services in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkServiceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateLinkServiceListResult"] + """Gets all private link service in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkServiceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices'} # type: ignore + + def get_private_endpoint_connection( + self, + resource_group_name, # type: str + service_name, # type: str + pe_connection_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Get the specific private end point connection by specific private link service in the resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. + :type pe_connection_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + def update_private_endpoint_connection( + self, + resource_group_name, # type: str + service_name, # type: str + pe_connection_name, # type: str + parameters, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Approve or reject private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. + :type pe_connection_name: str + :param parameters: Parameters supplied to approve or reject the private end point connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + service_name, # type: str + pe_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection( + self, + resource_group_name, # type: str + service_name, # type: str + pe_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete private end point connection for a private link service in a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :param pe_connection_name: The name of the private end point connection. + :type pe_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + service_name=service_name, + pe_connection_name=pe_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'peConnectionName': self._serialize.url("pe_connection_name", pe_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'} # type: ignore + + def list_private_endpoint_connections( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """Gets all private end point connections for a specific private link service. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the private link service. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_private_endpoint_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore + + def _check_private_link_service_visibility_initial( + self, + location, # type: str + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._check_private_link_service_visibility_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + def begin_check_private_link_service_visibility( + self, + location, # type: str + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] + """Checks whether the subscription is visible to private link service. + + :param location: The location of the domain name. + :type location: str + :param parameters: The request body of CheckPrivateLinkService API call. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._check_private_link_service_visibility_initial( + location=location, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_private_link_service_visibility.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + def _check_private_link_service_visibility_by_resource_group_initial( + self, + location, # type: str + resource_group_name, # type: str + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateLinkServiceVisibility"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._check_private_link_service_visibility_by_resource_group_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _check_private_link_service_visibility_by_resource_group_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + def begin_check_private_link_service_visibility_by_resource_group( + self, + location, # type: str + resource_group_name, # type: str + parameters, # type: "_models.CheckPrivateLinkServiceVisibilityRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateLinkServiceVisibility"] + """Checks whether the subscription is visible to private link service in the specified resource + group. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param parameters: The request body of CheckPrivateLinkService API call. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.CheckPrivateLinkServiceVisibilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateLinkServiceVisibility or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PrivateLinkServiceVisibility] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkServiceVisibility"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._check_private_link_service_visibility_by_resource_group_initial( + location=location, + resource_group_name=resource_group_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_private_link_service_visibility_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + + def list_auto_approved_private_link_services( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoApprovedPrivateLinkServicesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AutoApprovedPrivateLinkServicesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_auto_approved_private_link_services.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices'} # type: ignore + + def list_auto_approved_private_link_services_by_resource_group( + self, + location, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AutoApprovedPrivateLinkServicesResult"] + """Returns all of the private link service ids that can be linked to a Private Endpoint with auto + approved in this subscription in this region. + + :param location: The location of the domain name. + :type location: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoApprovedPrivateLinkServicesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoApprovedPrivateLinkServicesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AutoApprovedPrivateLinkServicesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_auto_approved_private_link_services_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_public_ip_addresses_operations.py new file mode 100644 index 0000000000000..5f80c47bae199 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_public_ip_addresses_operations.py @@ -0,0 +1,800 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PublicIPAddressesOperations(object): + """PublicIPAddressesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + public_ip_address_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + public_ip_address_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified public IP address. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + public_ip_address_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPAddress" + """Gets the specified public IP address in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPAddress, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + public_ip_address_name, # type: str + parameters, # type: "_models.PublicIPAddress" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPAddress" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PublicIPAddress') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + public_ip_address_name, # type: str + parameters, # type: "_models.PublicIPAddress" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PublicIPAddress"] + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public IP address operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PublicIPAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + public_ip_address_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPAddress" + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param parameters: Parameters supplied to update public IP address tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPAddress, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] + """Gets all the public IP addresses in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] + """Gets all public IP addresses in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore + + def list_virtual_machine_scale_set_public_ip_addresses( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] + """Gets information about all public IP addresses on a virtual machine scale set level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} # type: ignore + + def list_virtual_machine_scale_set_vm_public_ip_addresses( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + virtualmachine_index, # type: str + network_interface_name, # type: str + ip_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicIPAddressListResult"] + """Gets information about all public IP addresses in a virtual machine IP configuration in a + virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The network interface name. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. + :type ip_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} # type: ignore + + def get_virtual_machine_scale_set_public_ip_address( + self, + resource_group_name, # type: str + virtual_machine_scale_set_name, # type: str + virtualmachine_index, # type: str + network_interface_name, # type: str + ip_configuration_name, # type: str + public_ip_address_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPAddress" + """Get the specified public IP address in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. + :type public_ip_address_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPAddress, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + accept = "application/json" + + # Construct URL + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPAddress', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_public_ip_prefixes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_public_ip_prefixes_operations.py new file mode 100644 index 0000000000000..5b8a7801b4c70 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_public_ip_prefixes_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PublicIPPrefixesOperations(object): + """PublicIPPrefixesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + public_ip_prefix_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + public_ip_prefix_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified public IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIpPrefix. + :type public_ip_prefix_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + public_ip_prefix_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPPrefix" + """Gets the specified public IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + public_ip_prefix_name, # type: str + parameters, # type: "_models.PublicIPPrefix" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPPrefix" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PublicIPPrefix') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + public_ip_prefix_name, # type: str + parameters, # type: "_models.PublicIPPrefix" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PublicIPPrefix"] + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public IP prefix operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + public_ip_prefix_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicIPPrefix" + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to update public IP prefix tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicIPPrefix, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefix"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicIPPrefix', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] + """Gets all the public IP prefixes in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPPrefixListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicIPPrefixListResult"] + """Gets all public IP prefixes in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicIPPrefixListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPPrefixListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicIPPrefixListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_resource_navigation_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_resource_navigation_links_operations.py new file mode 100644 index 0000000000000..3fa9b5439c141 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_resource_navigation_links_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceNavigationLinksOperations(object): + """ResourceNavigationLinksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceNavigationLinksListResult" + """Gets a list of resource navigation links for a subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNavigationLinksListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ResourceNavigationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNavigationLinksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNavigationLinksListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_filter_rules_operations.py new file mode 100644 index 0000000000000..2caf03883e404 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_filter_rules_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RouteFilterRulesOperations(object): + """RouteFilterRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + route_filter_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + route_filter_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + route_filter_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteFilterRule" + """Gets the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteFilterRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteFilterRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + route_filter_name, # type: str + rule_name, # type: str + route_filter_rule_parameters, # type: "_models.RouteFilterRule" + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteFilterRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + route_filter_name, # type: str + rule_name, # type: str + route_filter_rule_parameters, # type: "_models.RouteFilterRule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteFilterRule"] + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create or update route filter + rule operation. + :type route_filter_rule_parameters: ~azure.mgmt.network.v2020_07_01.models.RouteFilterRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.RouteFilterRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteFilterRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore + + def list_by_route_filter( + self, + resource_group_name, # type: str + route_filter_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] + """Gets all RouteFilterRules in a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteFilterRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteFilterRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_route_filter.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteFilterRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_filters_operations.py new file mode 100644 index 0000000000000..e8e505a3837e7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_filters_operations.py @@ -0,0 +1,558 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RouteFiltersOperations(object): + """RouteFiltersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + route_filter_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + route_filter_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + route_filter_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteFilter" + """Gets the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param expand: Expands referenced express route bgp peering resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteFilter, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + route_filter_name, # type: str + route_filter_parameters, # type: "_models.RouteFilter" + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteFilter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + route_filter_name, # type: str + route_filter_parameters, # type: "_models.RouteFilter" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteFilter"] + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or update route filter + operation. + :type route_filter_parameters: ~azure.mgmt.network.v2020_07_01.models.RouteFilter + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.RouteFilter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + route_filter_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteFilter" + """Updates tags of a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param parameters: Parameters supplied to update route filter tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteFilter, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteFilter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteFilterListResult"] + """Gets all route filters in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteFilterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteFilterListResult"] + """Gets all route filters in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteFilterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_tables_operations.py new file mode 100644 index 0000000000000..8ad4032857e26 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_route_tables_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RouteTablesOperations(object): + """RouteTablesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + route_table_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteTable" + """Gets the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteTable, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + route_table_name, # type: str + parameters, # type: "_models.RouteTable" + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteTable" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RouteTable') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RouteTable', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + route_table_name, # type: str + parameters, # type: "_models.RouteTable" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RouteTable"] + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route table operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.RouteTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + route_table_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.RouteTable" + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param parameters: Parameters supplied to update route table tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RouteTable, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RouteTable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteTableListResult"] + """Gets all route tables in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteTableListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteTableListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteTableListResult"] + """Gets all route tables in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteTableListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteTableListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_routes_operations.py new file mode 100644 index 0000000000000..da97e29db29e5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_routes_operations.py @@ -0,0 +1,440 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RoutesOperations(object): + """RoutesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + route_table_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + route_table_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified route from a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + route_table_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Route" + """Gets the specified route from a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Route, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + route_table_name, # type: str + route_name, # type: str + route_parameters, # type: "_models.Route" + **kwargs # type: Any + ): + # type: (...) -> "_models.Route" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route_parameters, 'Route') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Route', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + route_table_name, # type: str + route_name, # type: str + route_parameters, # type: "_models.Route" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Route"] + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update route operation. + :type route_parameters: ~azure.mgmt.network.v2020_07_01.models.Route + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.Route] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + route_parameters=route_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Route', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RouteListResult"] + """Gets all routes in a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RouteListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RouteListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_security_partner_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_security_partner_providers_operations.py new file mode 100644 index 0000000000000..ecdcfedb94ea9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_security_partner_providers_operations.py @@ -0,0 +1,553 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SecurityPartnerProvidersOperations(object): + """SecurityPartnerProvidersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + security_partner_provider_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + security_partner_provider_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + security_partner_provider_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityPartnerProvider" + """Gets the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityPartnerProvider, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + security_partner_provider_name, # type: str + parameters, # type: "_models.SecurityPartnerProvider" + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityPartnerProvider" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SecurityPartnerProvider') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + security_partner_provider_name, # type: str + parameters, # type: "_models.SecurityPartnerProvider" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SecurityPartnerProvider"] + """Creates or updates the specified Security Partner Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to the create or update Security Partner Provider + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + security_partner_provider_name=security_partner_provider_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + security_partner_provider_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityPartnerProvider" + """Updates tags of a Security Partner Provider resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param security_partner_provider_name: The name of the Security Partner Provider. + :type security_partner_provider_name: str + :param parameters: Parameters supplied to update Security Partner Provider tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityPartnerProvider, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProvider"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'securityPartnerProviderName': self._serialize.url("security_partner_provider_name", security_partner_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityPartnerProvider', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] + """Lists all Security Partner Providers in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityPartnerProviderListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityPartnerProviderListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecurityPartnerProviderListResult"] + """Gets all the Security Partner Providers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityPartnerProviderListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityPartnerProviderListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityPartnerProviderListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_security_rules_operations.py new file mode 100644 index 0000000000000..75632ef7a710e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_security_rules_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SecurityRulesOperations(object): + """SecurityRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + security_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + security_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + security_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityRule" + """Get the specified network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SecurityRule, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + security_rule_name, # type: str + security_rule_parameters, # type: "_models.SecurityRule" + **kwargs # type: Any + ): + # type: (...) -> "_models.SecurityRule" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + security_rule_name, # type: str + security_rule_parameters, # type: "_models.SecurityRule" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SecurityRule"] + """Creates or updates a security rule in the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or update network security + rule operation. + :type security_rule_parameters: ~azure.mgmt.network.v2020_07_01.models.SecurityRule + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.SecurityRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + security_rule_parameters=security_rule_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SecurityRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + network_security_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SecurityRuleListResult"] + """Gets all security rules in a network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security group. + :type network_security_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_association_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_association_links_operations.py new file mode 100644 index 0000000000000..28c1118e2478e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_association_links_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServiceAssociationLinksOperations(object): + """ServiceAssociationLinksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceAssociationLinksListResult" + """Gets a list of service association links for a subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceAssociationLinksListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceAssociationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceAssociationLinksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceAssociationLinksListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_endpoint_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_endpoint_policies_operations.py new file mode 100644 index 0000000000000..990e4ad35f6f1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_endpoint_policies_operations.py @@ -0,0 +1,558 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServiceEndpointPoliciesOperations(object): + """ServiceEndpointPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceEndpointPolicy" + """Gets the specified service Endpoint Policies in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceEndpointPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + parameters, # type: "_models.ServiceEndpointPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceEndpointPolicy" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + parameters, # type: "_models.ServiceEndpointPolicy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ServiceEndpointPolicy"] + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service endpoint policy + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceEndpointPolicy" + """Updates tags of a service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to update service endpoint policy tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceEndpointPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceEndpointPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] + """Gets all the service endpoint policies in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServiceEndpointPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ServiceEndpointPolicyListResult"] + """Gets all service endpoint Policies in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServiceEndpointPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_endpoint_policy_definitions_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_endpoint_policy_definitions_operations.py new file mode 100644 index 0000000000000..61ea57b73aa89 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_endpoint_policy_definitions_operations.py @@ -0,0 +1,445 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServiceEndpointPolicyDefinitionsOperations(object): + """ServiceEndpointPolicyDefinitionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + service_endpoint_policy_definition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + service_endpoint_policy_definition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified ServiceEndpoint policy definitions. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the Service Endpoint Policy. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition. + :type service_endpoint_policy_definition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + service_endpoint_policy_definition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + """Get the specified service endpoint policy definitions from service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. + :type service_endpoint_policy_definition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceEndpointPolicyDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + service_endpoint_policy_definition_name, # type: str + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceEndpointPolicyDefinition" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + service_endpoint_policy_definition_name, # type: str + service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ServiceEndpointPolicyDefinition"] + """Creates or updates a service endpoint policy definition in the specified service endpoint + policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the service endpoint policy + definition name. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the create or update service + endpoint policy operation. + :type service_endpoint_policy_definitions: ~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinition] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinition"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + service_endpoint_policy_definitions=service_endpoint_policy_definitions, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + service_endpoint_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ServiceEndpointPolicyDefinitionListResult"] + """Gets all service endpoint policy definitions in a service end point policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint policy name. + :type service_endpoint_policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServiceEndpointPolicyDefinitionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ServiceEndpointPolicyDefinitionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceEndpointPolicyDefinitionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ServiceEndpointPolicyDefinitionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_tags_operations.py new file mode 100644 index 0000000000000..c4251eee5d8a3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_tags_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServiceTagsOperations(object): + """ServiceTagsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceTagsListResult" + """Gets a list of service tag information resources. + + :param location: The location that will be used as a reference for version (not as a filter + based on location, you will get the list of service tags with prefix details across all regions + but limited to the cloud that your subscription belongs to). + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceTagsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ServiceTagsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceTagsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceTagsListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_subnets_operations.py new file mode 100644 index 0000000000000..c96a2e5e8e6a1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_subnets_operations.py @@ -0,0 +1,701 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SubnetsOperations(object): + """SubnetsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.Subnet" + """Gets the specified subnet by virtual network and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Subnet, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.Subnet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Subnet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + subnet_parameters, # type: "_models.Subnet" + **kwargs # type: Any + ): + # type: (...) -> "_models.Subnet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(subnet_parameters, 'Subnet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Subnet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Subnet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + subnet_parameters, # type: "_models.Subnet" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Subnet"] + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update subnet operation. + :type subnet_parameters: ~azure.mgmt.network.v2020_07_01.models.Subnet + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.Subnet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subnet_parameters=subnet_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Subnet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore + + def _prepare_network_policies_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._prepare_network_policies_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _prepare_network_policies_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies'} # type: ignore + + def begin_prepare_network_policies( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + prepare_network_policies_request_parameters, # type: "_models.PrepareNetworkPoliciesRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Prepares a subnet by applying network intent policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param prepare_network_policies_request_parameters: Parameters supplied to prepare subnet by + applying network intent policies. + :type prepare_network_policies_request_parameters: ~azure.mgmt.network.v2020_07_01.models.PrepareNetworkPoliciesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._prepare_network_policies_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + prepare_network_policies_request_parameters=prepare_network_policies_request_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_prepare_network_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies'} # type: ignore + + def _unprepare_network_policies_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._unprepare_network_policies_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _unprepare_network_policies_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies'} # type: ignore + + def begin_unprepare_network_policies( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + subnet_name, # type: str + unprepare_network_policies_request_parameters, # type: "_models.UnprepareNetworkPoliciesRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Unprepares a subnet by removing network intent policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param unprepare_network_policies_request_parameters: Parameters supplied to unprepare subnet + to remove network intent policies. + :type unprepare_network_policies_request_parameters: ~azure.mgmt.network.v2020_07_01.models.UnprepareNetworkPoliciesRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._unprepare_network_policies_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + unprepare_network_policies_request_parameters=unprepare_network_policies_request_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_unprepare_network_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SubnetListResult"] + """Gets all subnets in a virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SubnetListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.SubnetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SubnetListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_usages_operations.py new file mode 100644 index 0000000000000..dc5f7fec4e833 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_usages_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsagesListResult"] + """List network usages for a subscription. + + :param location: The location where resource usage is queried. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._ ]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_appliance_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_appliance_sites_operations.py new file mode 100644 index 0000000000000..9b829b05f0c03 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_appliance_sites_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualApplianceSitesOperations(object): + """VirtualApplianceSitesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified site from a Virtual Appliance. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualApplianceSite" + """Gets the specified Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualApplianceSite, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + site_name, # type: str + parameters, # type: "_models.VirtualApplianceSite" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualApplianceSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualApplianceSite') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + site_name, # type: str + parameters, # type: "_models.VirtualApplianceSite" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualApplianceSite"] + """Creates or updates the specified Network Virtual Appliance Site. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :param site_name: The name of the site. + :type site_name: str + :param parameters: Parameters supplied to the create or update Network Virtual Appliance Site + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualApplianceSite or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualApplianceSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualApplianceSite"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_virtual_appliance_name=network_virtual_appliance_name, + site_name=site_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualApplianceSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + network_virtual_appliance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkVirtualApplianceSiteListResult"] + """Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_virtual_appliance_name: The name of the Network Virtual Appliance. + :type network_virtual_appliance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceSiteListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSiteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkVirtualApplianceName': self._serialize.url("network_virtual_appliance_name", network_virtual_appliance_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceSiteListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_appliance_skus_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_appliance_skus_operations.py new file mode 100644 index 0000000000000..23448ebfc38aa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_appliance_skus_operations.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualApplianceSkusOperations(object): + """VirtualApplianceSkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkVirtualApplianceSkuListResult"] + """List all SKUs available for a virtual appliance. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkVirtualApplianceSkuListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NetworkVirtualApplianceSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus'} # type: ignore + + def get( + self, + sku_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkVirtualApplianceSku" + """Retrieves a single available sku for network virtual appliance. + + :param sku_name: Name of the Sku. + :type sku_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkVirtualApplianceSku, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.NetworkVirtualApplianceSku + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkVirtualApplianceSku"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'skuName': self._serialize.url("sku_name", sku_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkVirtualApplianceSku', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_bgp_connection_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_bgp_connection_operations.py new file mode 100644 index 0000000000000..17acb0334d2da --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_bgp_connection_operations.py @@ -0,0 +1,365 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubBgpConnectionOperations(object): + """VirtualHubBgpConnectionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BgpConnection" + """Retrieves the details of a Virtual Hub Bgp Connection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BgpConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.BgpConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + parameters, # type: "_models.BgpConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.BgpConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BgpConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + parameters, # type: "_models.BgpConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BgpConnection"] + """Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing + VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :param parameters: Parameters of Bgp connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.BgpConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BgpConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.BgpConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BgpConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VirtualHubBgpConnection. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_bgp_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_bgp_connections_operations.py new file mode 100644 index 0000000000000..52c4e24c4a9e2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_bgp_connections_operations.py @@ -0,0 +1,373 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubBgpConnectionsOperations(object): + """VirtualHubBgpConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualHubBgpConnectionResults"] + """Retrieves the details of all VirtualHubBgpConnections. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubBgpConnectionResults or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubBgpConnectionResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubBgpConnectionResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubBgpConnectionResults', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections'} # type: ignore + + def _list_learned_routes_initial( + self, + resource_group_name, # type: str + hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_learned_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_learned_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes'} # type: ignore + + def begin_list_learned_routes( + self, + resource_group_name, # type: str + hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PeerRouteList"] + """Retrieves a list of routes the virtual hub bgp connection has learned. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PeerRouteList or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PeerRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_learned_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes'} # type: ignore + + def _list_advertised_routes_initial( + self, + resource_group_name, # type: str + hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.PeerRouteList"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PeerRouteList"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_advertised_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_advertised_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes'} # type: ignore + + def begin_list_advertised_routes( + self, + resource_group_name, # type: str + hub_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PeerRouteList"] + """Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param hub_name: The name of the virtual hub. + :type hub_name: str + :param connection_name: The name of the virtual hub bgp connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PeerRouteList or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.PeerRouteList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PeerRouteList"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_advertised_routes_initial( + resource_group_name=resource_group_name, + hub_name=hub_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PeerRouteList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hubName': self._serialize.url("hub_name", hub_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_ip_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_ip_configuration_operations.py new file mode 100644 index 0000000000000..32071f968880a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_ip_configuration_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubIpConfigurationOperations(object): + """VirtualHubIpConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + ip_config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HubIpConfiguration" + """Retrieves the details of a Virtual Hub Ip configuration. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. + :type ip_config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HubIpConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + ip_config_name, # type: str + parameters, # type: "_models.HubIpConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.HubIpConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'HubIpConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + ip_config_name, # type: str + parameters, # type: "_models.HubIpConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.HubIpConfiguration"] + """Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. + :type ip_config_name: str + :param parameters: Hub Ip Configuration parameters. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either HubIpConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.HubIpConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.HubIpConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('HubIpConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + ip_config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + ip_config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VirtualHubIpConfiguration. + + :param resource_group_name: The resource group name of the VirtualHubBgpConnection. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param ip_config_name: The name of the ipconfig. + :type ip_config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + ip_config_name=ip_config_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'ipConfigName': self._serialize.url("ip_config_name", ip_config_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualHubIpConfigurationResults"] + """Retrieves the details of all VirtualHubIpConfigurations. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubIpConfigurationResults or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubIpConfigurationResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubIpConfigurationResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubIpConfigurationResults', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_route_table_v2_s_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_route_table_v2_s_operations.py new file mode 100644 index 0000000000000..731e0bfb8b9fa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -0,0 +1,445 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubRouteTableV2SOperations(object): + """VirtualHubRouteTableV2SOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualHubRouteTableV2" + """Retrieves the details of a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualHubRouteTableV2, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualHubRouteTableV2" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_hub_route_table_v2_parameters, 'VirtualHubRouteTableV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + virtual_hub_route_table_v2_parameters, # type: "_models.VirtualHubRouteTableV2" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualHubRouteTableV2"] + """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing + VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. + :type route_table_name: str + :param virtual_hub_route_table_v2_parameters: Parameters supplied to create or update + VirtualHubRouteTableV2. + :type virtual_hub_route_table_v2_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualHubRouteTableV2] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHubRouteTableV2"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + virtual_hub_route_table_v2_parameters=virtual_hub_route_table_v2_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualHubRouteTableV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + route_table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VirtualHubRouteTableV2. + + :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param route_table_name: The name of the VirtualHubRouteTableV2. + :type route_table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + route_table_name=route_table_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualHubRouteTableV2SResult"] + """Retrieves the details of all VirtualHubRouteTableV2s. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubRouteTableV2SResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubRouteTableV2SResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubRouteTableV2SResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubRouteTableV2SResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hubs_operations.py new file mode 100644 index 0000000000000..a42457bb0f7cb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_hubs_operations.py @@ -0,0 +1,676 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualHubsOperations(object): + """VirtualHubsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualHub" + """Retrieves the details of a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualHub, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + virtual_hub_parameters, # type: "_models.VirtualHub" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualHub" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + virtual_hub_parameters, # type: "_models.VirtualHub" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualHub"] + """Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to create or update VirtualHub. + :type virtual_hub_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualHub + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + virtual_hub_parameters=virtual_hub_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + virtual_hub_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualHub" + """Updates VirtualHub tags. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param virtual_hub_parameters: Parameters supplied to update VirtualHub tags. + :type virtual_hub_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualHub, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualHub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualHub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VirtualHub. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] + """Lists all the VirtualHubs in a resource group. + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualHubsResult"] + """Lists all the VirtualHubs in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualHubsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualHubsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualHubsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs'} # type: ignore + + def _get_effective_virtual_hub_routes_initial( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + effective_routes_parameters=None, # type: Optional["_models.EffectiveRoutesParameters"] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._get_effective_virtual_hub_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if effective_routes_parameters is not None: + body_content = self._serialize.body(effective_routes_parameters, 'EffectiveRoutesParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _get_effective_virtual_hub_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes'} # type: ignore + + def begin_get_effective_virtual_hub_routes( + self, + resource_group_name, # type: str + virtual_hub_name, # type: str + effective_routes_parameters=None, # type: Optional["_models.EffectiveRoutesParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Gets the effective routes configured for the Virtual Hub resource or the specified resource . + + :param resource_group_name: The resource group name of the VirtualHub. + :type resource_group_name: str + :param virtual_hub_name: The name of the VirtualHub. + :type virtual_hub_name: str + :param effective_routes_parameters: Parameters supplied to get the effective routes for a + specific resource. + :type effective_routes_parameters: ~azure.mgmt.network.v2020_07_01.models.EffectiveRoutesParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_effective_virtual_hub_routes_initial( + resource_group_name=resource_group_name, + virtual_hub_name=virtual_hub_name, + effective_routes_parameters=effective_routes_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualHubName': self._serialize.url("virtual_hub_name", virtual_hub_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_effective_virtual_hub_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateway_connections_operations.py new file mode 100644 index 0000000000000..dfe694953c778 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateway_connections_operations.py @@ -0,0 +1,1143 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkGatewayConnectionsOperations(object): + """VirtualNetworkGatewayConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.VirtualNetworkGatewayConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.VirtualNetworkGatewayConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] + """Creates or updates a virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual network gateway + connection operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkGatewayConnection" + """Gets the specified virtual network gateway connection by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkGatewayConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified virtual network Gateway connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGatewayConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def begin_update_tags( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to update virtual network gateway connection tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore + + def _set_shared_key_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.ConnectionSharedKey" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionSharedKey" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._set_shared_key_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectionSharedKey') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _set_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore + + def begin_set_shared_key( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.ConnectionSharedKey" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConnectionSharedKey"] + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection name. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection + Shared key operation throughNetwork resource provider. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectionSharedKey + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._set_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore + + def get_shared_key( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionSharedKey" + """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the + specified virtual network gateway connection shared key through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection shared + key name. + :type virtual_network_gateway_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionSharedKey, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.ConnectionSharedKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get_shared_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] + """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways + connections created. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkGatewayConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} # type: ignore + + def _reset_shared_key_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.ConnectionResetSharedKey" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_shared_key_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore + + def begin_reset_shared_key( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.ConnectionResetSharedKey" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway + connection shared key for passed virtual network gateway connection in the specified resource + group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network gateway connection reset + shared key Name. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the begin reset virtual network gateway connection + shared key operation through network resource provider. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.ConnectionResetSharedKey + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.ConnectionResetSharedKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore + + def _start_packet_capture_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture'} # type: ignore + + def begin_start_packet_capture( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Starts packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture'} # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.VpnPacketCaptureStopParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture'} # type: ignore + + def begin_stop_packet_capture( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.VpnPacketCaptureStopParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Stops packet capture on virtual network gateway connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + Connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateways_operations.py new file mode 100644 index 0000000000000..fe1a96c57dce0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateways_operations.py @@ -0,0 +1,2483 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkGatewaysOperations(object): + """VirtualNetworkGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VirtualNetworkGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VirtualNetworkGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] + """Creates or updates a virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual network gateway operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkGateway" + """Gets the specified virtual network gateway by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified virtual network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def begin_update_tags( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to update virtual network gateway tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] + """Gets all virtual network gateways by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkGatewayListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} # type: ignore + + def list_connections( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] + """Gets all the connections in a virtual network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkGatewayListConnectionsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGatewayListConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGatewayListConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} # type: ignore + + def _reset_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + gateway_vip=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if gateway_vip is not None: + query_parameters['gatewayVip'] = self._serialize.query("gateway_vip", gateway_vip, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore + + def begin_reset( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + gateway_vip=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] + """Resets the primary of the virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param gateway_vip: Virtual network gateway vip address supplied to the begin reset of the + active-active feature enabled gateway. + :type gateway_vip: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + gateway_vip=gateway_vip, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore + + def _reset_vpn_client_shared_key_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_vpn_client_shared_key_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_vpn_client_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey'} # type: ignore + + def begin_reset_vpn_client_shared_key( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Resets the VPN client shared key of the virtual network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_vpn_client_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_vpn_client_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey'} # type: ignore + + def _generatevpnclientpackage_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VpnClientParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generatevpnclientpackage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnClientParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generatevpnclientpackage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore + + def begin_generatevpnclientpackage( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VpnClientParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Generates VPN client package for P2S client of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnClientParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._generatevpnclientpackage_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore + + def _generate_vpn_profile_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VpnClientParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._generate_vpn_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnClientParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _generate_vpn_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore + + def begin_generate_vpn_profile( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VpnClientParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Generates VPN profile for P2S client of the virtual network gateway in the specified resource + group. Used for IKEV2 and radius based authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network gateway VPN client + package operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnClientParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore + + def _get_vpn_profile_package_url_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_vpn_profile_package_url_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vpn_profile_package_url_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore + + def begin_get_vpn_profile_package_url( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified + resource group. The profile needs to be generated first using generateVpnProfile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_vpn_profile_package_url_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore + + def _get_bgp_peer_status_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + peer=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_bgp_peer_status_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if peer is not None: + query_parameters['peer'] = self._serialize.query("peer", peer, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_bgp_peer_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore + + def begin_get_bgp_peer_status( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + peer=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] + """The GetBgpPeerStatus operation retrieves the status of all BGP peers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param peer: The IP address of the peer to retrieve the status of. + :type peer: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.BgpPeerStatusListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_bgp_peer_status_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore + + def supported_vpn_devices( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Gets a xml format representation for supported vpn devices. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.supported_vpn_devices.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + supported_vpn_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'} # type: ignore + + def _get_learned_routes_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_learned_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_learned_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore + + def begin_get_learned_routes( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] + """This operation retrieves a list of routes the virtual network gateway has learned, including + routes learned from BGP peers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_learned_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore + + def _get_advertised_routes_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + peer, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_advertised_routes_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['peer'] = self._serialize.query("peer", peer, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_advertised_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore + + def begin_get_advertised_routes( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + peer, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GatewayRouteListResult"] + """This operation retrieves a list of routes the virtual network gateway is advertising to the + specified peer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param peer: The IP address of the peer. + :type peer: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.GatewayRouteListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_advertised_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore + + def _set_vpnclient_ipsec_parameters_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientIPsecParameters"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._set_vpnclient_ipsec_parameters_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _set_vpnclient_ipsec_parameters_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'} # type: ignore + + def begin_set_vpnclient_ipsec_parameters( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + vpnclient_ipsec_params, # type: "_models.VpnClientIPsecParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] + """The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of + virtual network gateway in the specified resource group through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param vpnclient_ipsec_params: Parameters supplied to the Begin Set vpnclient ipsec parameters + of Virtual Network Gateway P2S client operation through Network resource provider. + :type vpnclient_ipsec_params: ~azure.mgmt.network.v2020_07_01.models.VpnClientIPsecParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._set_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + vpnclient_ipsec_params=vpnclient_ipsec_params, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_set_vpnclient_ipsec_parameters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'} # type: ignore + + def _get_vpnclient_ipsec_parameters_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnClientIPsecParameters" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_vpnclient_ipsec_parameters_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vpnclient_ipsec_parameters_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'} # type: ignore + + def begin_get_vpnclient_ipsec_parameters( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnClientIPsecParameters"] + """The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec + policy for P2S client of virtual network gateway in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The virtual network gateway name. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnClientIPsecParameters] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientIPsecParameters"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_vpnclient_ipsec_parameters_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnClientIPsecParameters', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vpnclient_ipsec_parameters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'} # type: ignore + + def vpn_device_configuration_script( + self, + resource_group_name, # type: str + virtual_network_gateway_connection_name, # type: str + parameters, # type: "_models.VpnDeviceScriptParameters" + **kwargs # type: Any + ): + # type: (...) -> str + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the virtual network gateway + connection for which the configuration script is generated. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device script operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnDeviceScriptParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.vpn_device_configuration_script.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + vpn_device_configuration_script.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'} # type: ignore + + def _start_packet_capture_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture'} # type: ignore + + def begin_start_packet_capture( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters=None, # type: Optional["_models.VpnPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Starts packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to start packet + capture on gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture'} # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VpnPacketCaptureStopParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture'} # type: ignore + + def begin_stop_packet_capture( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + parameters, # type: "_models.VpnPacketCaptureStopParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Stops packet capture on virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param parameters: Virtual network gateway packet capture parameters supplied to stop packet + capture on gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture'} # type: ignore + + def _get_vpnclient_connection_health_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnClientConnectionHealthDetailListResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._get_vpnclient_connection_health_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnClientConnectionHealthDetailListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_vpnclient_connection_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth'} # type: ignore + + def begin_get_vpnclient_connection_health( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnClientConnectionHealthDetailListResult"] + """Get VPN client connection health detail per P2S client connection of the virtual network + gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnClientConnectionHealthDetailListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnClientConnectionHealthDetailListResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_vpnclient_connection_health_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnClientConnectionHealthDetailListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_vpnclient_connection_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth'} # type: ignore + + def _disconnect_virtual_network_gateway_vpn_connections_initial( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + request, # type: "_models.P2SVpnConnectionRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._disconnect_virtual_network_gateway_vpn_connections_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _disconnect_virtual_network_gateway_vpn_connections_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections'} # type: ignore + + def begin_disconnect_virtual_network_gateway_vpn_connections( + self, + resource_group_name, # type: str + virtual_network_gateway_name, # type: str + request, # type: "_models.P2SVpnConnectionRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Disconnect vpn connections of virtual network gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network gateway. + :type virtual_network_gateway_name: str + :param request: The parameters are supplied to disconnect vpn connections. + :type request: ~azure.mgmt.network.v2020_07_01.models.P2SVpnConnectionRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._disconnect_virtual_network_gateway_vpn_connections_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disconnect_virtual_network_gateway_vpn_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_peerings_operations.py new file mode 100644 index 0000000000000..8834b31ba645e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_peerings_operations.py @@ -0,0 +1,441 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkPeeringsOperations(object): + """VirtualNetworkPeeringsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + virtual_network_peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + virtual_network_peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified virtual network peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. + :type virtual_network_peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + virtual_network_peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkPeering" + """Gets the specified virtual network peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network peering. + :type virtual_network_peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + virtual_network_peering_name, # type: str + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + virtual_network_peering_name, # type: str + virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual + network peering operation. + :type virtual_network_peering_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + virtual_network_peering_parameters=virtual_network_peering_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] + """Gets all virtual network peerings in a virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkPeeringListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkPeeringListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_taps_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_taps_operations.py new file mode 100644 index 0000000000000..bdd69b462c659 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_taps_operations.py @@ -0,0 +1,552 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworkTapsOperations(object): + """VirtualNetworkTapsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + tap_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + tap_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified virtual network tap. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. + :type tap_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + tap_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkTap" + """Gets information about the specified virtual network tap. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of virtual network tap. + :type tap_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkTap, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + tap_name, # type: str + parameters, # type: "_models.VirtualNetworkTap" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkTap" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetworkTap') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + tap_name, # type: str + parameters, # type: "_models.VirtualNetworkTap" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetworkTap"] + """Creates or updates a Virtual Network Tap. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of the virtual network tap. + :type tap_name: str + :param parameters: Parameters supplied to the create or update virtual network tap operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + tap_name=tap_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + tap_name, # type: str + tap_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetworkTap" + """Updates an VirtualNetworkTap tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param tap_name: The name of the tap. + :type tap_name: str + :param tap_parameters: Parameters supplied to update VirtualNetworkTap tags. + :type tap_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetworkTap, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTap"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'tapName': self._serialize.url("tap_name", tap_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(tap_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetworkTap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] + """Gets all the VirtualNetworkTaps in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkTapListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkTapListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkTapListResult"] + """Gets all the VirtualNetworkTaps in a subscription. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkTapListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkTapListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkTapListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_networks_operations.py new file mode 100644 index 0000000000000..d66860d96834f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_networks_operations.py @@ -0,0 +1,695 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworksOperations(object): + """VirtualNetworksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetwork" + """Gets the specified virtual network by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + parameters, # type: "_models.VirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + parameters, # type: "_models.VirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetwork"] + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual network operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetwork" + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param parameters: Parameters supplied to update virtual network tags. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] + """Gets all virtual networks in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} # type: ignore + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkListResult"] + """Gets all virtual networks in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} # type: ignore + + def check_ip_address_availability( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + ip_address, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.IPAddressAvailabilityResult" + """Checks whether a private IP address is available for use. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param ip_address: The private IP address to be verified. + :type ip_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IPAddressAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.IPAddressAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.check_ip_address_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['ipAddress'] = self._serialize.query("ip_address", ip_address, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IPAddressAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} # type: ignore + + def list_usage( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] + """Lists usage stats. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworkListUsageResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkListUsageResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usage.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworkListUsageResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_router_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_router_peerings_operations.py new file mode 100644 index 0000000000000..59a7c10c933c6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_router_peerings_operations.py @@ -0,0 +1,445 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualRouterPeeringsOperations(object): + """VirtualRouterPeeringsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified peering from a Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + peering_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualRouterPeering" + """Gets the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. + :type peering_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualRouterPeering, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + peering_name, # type: str + parameters, # type: "_models.VirtualRouterPeering" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualRouterPeering" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualRouterPeering') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + peering_name, # type: str + parameters, # type: "_models.VirtualRouterPeering" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualRouterPeering"] + """Creates or updates the specified Virtual Router Peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param peering_name: The name of the Virtual Router Peering. + :type peering_name: str + :param parameters: Parameters supplied to the create or update Virtual Router Peering + operation. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeering] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeering"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + peering_name=peering_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualRouterPeering', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualRouterPeeringListResult"] + """Lists all Virtual Router Peerings in a Virtual Router resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualRouterPeeringListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualRouterPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterPeeringListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualRouterPeeringListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_routers_operations.py new file mode 100644 index 0000000000000..249d3f4e6038a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_routers_operations.py @@ -0,0 +1,495 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualRoutersOperations(object): + """VirtualRoutersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualRouter" + """Gets the specified Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param expand: Expands referenced resources. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualRouter, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualRouter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + parameters, # type: "_models.VirtualRouter" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualRouter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VirtualRouter') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_router_name, # type: str + parameters, # type: "_models.VirtualRouter" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualRouter"] + """Creates or updates the specified Virtual Router. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_router_name: The name of the Virtual Router. + :type virtual_router_name: str + :param parameters: Parameters supplied to the create or update Virtual Router. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualRouter + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualRouter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouter"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_router_name=virtual_router_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualRouter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualRouterName': self._serialize.url("virtual_router_name", virtual_router_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualRouterListResult"] + """Lists all Virtual Routers in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualRouterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualRouterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualRouterListResult"] + """Gets all the Virtual Routers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualRouterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualRouterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualRouterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.Error, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_wans_operations.py new file mode 100644 index 0000000000000..dcfa9261fdd29 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_wans_operations.py @@ -0,0 +1,552 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualWansOperations(object): + """VirtualWansOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualWAN" + """Retrieves the details of a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being retrieved. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualWAN, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + wan_parameters, # type: "_models.VirtualWAN" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualWAN" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(wan_parameters, 'VirtualWAN') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + wan_parameters, # type: "_models.VirtualWAN" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualWAN"] + """Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being created or updated. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to create or update VirtualWAN. + :type wan_parameters: ~azure.mgmt.network.v2020_07_01.models.VirtualWAN + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VirtualWAN] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + wan_parameters=wan_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + wan_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualWAN" + """Updates a VirtualWAN tags. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being updated. + :type virtual_wan_name: str + :param wan_parameters: Parameters supplied to Update VirtualWAN tags. + :type wan_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualWAN, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualWAN"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(wan_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualWAN', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VirtualWAN. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN being deleted. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'VirtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] + """Lists all the VirtualWANs in a resource group. + + :param resource_group_name: The resource group name of the VirtualWan. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualWANsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualWANsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVirtualWANsResult"] + """Lists all the VirtualWANs in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVirtualWANsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVirtualWANsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVirtualWANsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_connections_operations.py new file mode 100644 index 0000000000000..f2b629052858d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_connections_operations.py @@ -0,0 +1,719 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnConnectionsOperations(object): + """VpnConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnConnection" + """Retrieves the details of a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + vpn_connection_parameters, # type: "_models.VpnConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + vpn_connection_parameters, # type: "_models.VpnConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnConnection"] + """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the + existing connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :param vpn_connection_parameters: Parameters supplied to create or Update a VPN Connection. + :type vpn_connection_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + vpn_connection_parameters=vpn_connection_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a vpn connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + connection_name=connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'} # type: ignore + + def _start_packet_capture_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_connection_name, # type: str + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnConnectionPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture'} # type: ignore + + def begin_start_packet_capture( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_connection_name, # type: str + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Starts packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to start packet capture on + gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnConnectionPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture'} # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_connection_name, # type: str + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStopParameters"] + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnConnectionPacketCaptureStopParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture'} # type: ignore + + def begin_stop_packet_capture( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_connection_name, # type: str + parameters=None, # type: Optional["_models.VpnConnectionPacketCaptureStopParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Stops packet capture on Vpn connection in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_connection_name: The name of the vpn connection. + :type vpn_connection_name: str + :param parameters: Vpn Connection packet capture parameters supplied to stop packet capture on + gateway connection. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnConnectionPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_connection_name=vpn_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'vpnConnectionName': self._serialize.url("vpn_connection_name", vpn_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture'} # type: ignore + + def list_by_vpn_gateway( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnConnectionsResult"] + """Retrieves all vpn connections for a particular virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnConnectionsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vpn_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_vpn_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_gateways_operations.py new file mode 100644 index 0000000000000..d2330148cdcdb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_gateways_operations.py @@ -0,0 +1,996 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnGatewaysOperations(object): + """VpnGatewaysOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnGateway" + """Retrieves the details of a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnGateway, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_gateway_parameters, # type: "_models.VpnGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnGateway" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_gateway_parameters, # type: "_models.VpnGateway" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnGateway"] + """Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to create or Update a virtual wan vpn + gateway. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_gateway_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def begin_update_tags( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_gateway_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnGateway"] + """Updates virtual wan vpn gateway tags. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param vpn_gateway_parameters: Parameters supplied to update a virtual wan vpn gateway tags. + :type vpn_gateway_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + vpn_gateway_parameters=vpn_gateway_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a virtual wan vpn gateway. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}'} # type: ignore + + def _reset_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnGateway"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._reset_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset'} # type: ignore + + def begin_reset( + self, + resource_group_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnGateway"] + """Resets the primary of the vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnGateway"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset'} # type: ignore + + def _start_packet_capture_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._start_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnGatewayPacketCaptureStartParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture'} # type: ignore + + def begin_start_packet_capture( + self, + resource_group_name, # type: str + gateway_name, # type: str + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStartParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Starts packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to start packet capture on + vpn gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnGatewayPacketCaptureStartParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture'} # type: ignore + + def _stop_packet_capture_initial( + self, + resource_group_name, # type: str + gateway_name, # type: str + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStopParameters"] + **kwargs # type: Any + ): + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_packet_capture_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'VpnGatewayPacketCaptureStopParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _stop_packet_capture_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture'} # type: ignore + + def begin_stop_packet_capture( + self, + resource_group_name, # type: str + gateway_name, # type: str + parameters=None, # type: Optional["_models.VpnGatewayPacketCaptureStopParameters"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[str] + """Stops packet capture on vpn gateway in the specified resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param parameters: Vpn gateway packet capture parameters supplied to stop packet capture on vpn + gateway. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.VpnGatewayPacketCaptureStopParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[str] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_packet_capture_initial( + resource_group_name=resource_group_name, + gateway_name=gateway_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop_packet_capture.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] + """Lists all the VpnGateways in a resource group. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnGatewaysResult"] + """Lists all the VpnGateways in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnGatewaysResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnGatewaysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnGatewaysResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_link_connections_operations.py new file mode 100644 index 0000000000000..6175e6345b0fa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_link_connections_operations.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnLinkConnectionsOperations(object): + """VpnLinkConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_vpn_connection( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnSiteLinkConnectionsResult"] + """Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn + connection. + + :param resource_group_name: The resource group name of the vpn gateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSiteLinkConnectionsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSiteLinkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinkConnectionsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vpn_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSiteLinkConnectionsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_vpn_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py new file mode 100644 index 0000000000000..af718dc533e80 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -0,0 +1,166 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnServerConfigurationsAssociatedWithVirtualWanOperations(object): + """VpnServerConfigurationsAssociatedWithVirtualWanOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _list_initial( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VpnServerConfigurationsResponse"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._list_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VpnServerConfigurationsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations'} # type: ignore + + def begin_list( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnServerConfigurationsResponse"] + """Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN whose associated VpnServerConfigurations is + needed. + :type virtual_wan_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnServerConfigurationsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfigurationsResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnServerConfigurationsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_server_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_server_configurations_operations.py new file mode 100644 index 0000000000000..7a6c2a0d4467c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_server_configurations_operations.py @@ -0,0 +1,556 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnServerConfigurationsOperations(object): + """VpnServerConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + vpn_server_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnServerConfiguration" + """Retrieves the details of a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being retrieved. + :type vpn_server_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnServerConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + vpn_server_configuration_name, # type: str + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnServerConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vpn_server_configuration_name, # type: str + vpn_server_configuration_parameters, # type: "_models.VpnServerConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnServerConfiguration"] + """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing + VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being created or + updated. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to create or update + VpnServerConfiguration. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + vpn_server_configuration_parameters=vpn_server_configuration_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + vpn_server_configuration_name, # type: str + vpn_server_configuration_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnServerConfiguration" + """Updates VpnServerConfiguration tags. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being updated. + :type vpn_server_configuration_name: str + :param vpn_server_configuration_parameters: Parameters supplied to update + VpnServerConfiguration tags. + :type vpn_server_configuration_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnServerConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnServerConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnServerConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vpn_server_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vpn_server_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VpnServerConfiguration. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :param vpn_server_configuration_name: The name of the VpnServerConfiguration being deleted. + :type vpn_server_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + vpn_server_configuration_name=vpn_server_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnServerConfigurationName': self._serialize.url("vpn_server_configuration_name", vpn_server_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] + """Lists all the vpnServerConfigurations in a resource group. + + :param resource_group_name: The resource group name of the VpnServerConfiguration. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnServerConfigurationsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnServerConfigurationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnServerConfigurationsResult"] + """Lists all the VpnServerConfigurations in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnServerConfigurationsResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnServerConfigurationsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnServerConfigurationsResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_site_link_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_site_link_connections_operations.py new file mode 100644 index 0000000000000..5e0144e89b43c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_site_link_connections_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnSiteLinkConnectionsOperations(object): + """VpnSiteLinkConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + gateway_name, # type: str + connection_name, # type: str + link_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnSiteLinkConnection" + """Retrieves the details of a vpn site link connection. + + :param resource_group_name: The resource group name of the VpnGateway. + :type resource_group_name: str + :param gateway_name: The name of the gateway. + :type gateway_name: str + :param connection_name: The name of the vpn connection. + :type connection_name: str + :param link_connection_name: The name of the vpn connection. + :type link_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSiteLinkConnection, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSiteLinkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLinkConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'linkConnectionName': self._serialize.url("link_connection_name", link_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSiteLinkConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_site_links_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_site_links_operations.py new file mode 100644 index 0000000000000..23f3b28544c5b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_site_links_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnSiteLinksOperations(object): + """VpnSiteLinksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + vpn_site_link_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnSiteLink" + """Retrieves the details of a VPN site link. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. + :type vpn_site_name: str + :param vpn_site_link_name: The name of the VpnSiteLink being retrieved. + :type vpn_site_link_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSiteLink, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSiteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSiteLink"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + 'vpnSiteLinkName': self._serialize.url("vpn_site_link_name", vpn_site_link_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSiteLink', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}'} # type: ignore + + def list_by_vpn_site( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnSiteLinksResult"] + """Lists all the vpnSiteLinks in a resource group for a vpn site. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite. + :type vpn_site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSiteLinksResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSiteLinksResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSiteLinksResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vpn_site.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSiteLinksResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_vpn_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_configuration_operations.py new file mode 100644 index 0000000000000..ca5bc7fad2500 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_configuration_operations.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnSitesConfigurationOperations(object): + """VpnSitesConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _download_initial( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + request, # type: "_models.GetVpnSitesConfigurationRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._download_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _download_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration'} # type: ignore + + def begin_download( + self, + resource_group_name, # type: str + virtual_wan_name, # type: str + request, # type: "_models.GetVpnSitesConfigurationRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Gives the sas-url to download the configurations for vpn-sites in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is + needed. + :type virtual_wan_name: str + :param request: Parameters supplied to download vpn-sites configuration. + :type request: ~azure.mgmt.network.v2020_07_01.models.GetVpnSitesConfigurationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._download_initial( + resource_group_name=resource_group_name, + virtual_wan_name=virtual_wan_name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_download.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_operations.py new file mode 100644 index 0000000000000..a5e9e9d01dc28 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_operations.py @@ -0,0 +1,552 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VpnSitesOperations(object): + """VpnSitesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnSite" + """Retrieves the details of a VPN site. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being retrieved. + :type vpn_site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSite, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + vpn_site_parameters, # type: "_models.VpnSite" + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnSite" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VpnSite', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + vpn_site_parameters, # type: "_models.VpnSite" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VpnSite"] + """Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being created or updated. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to create or update VpnSite. + :type vpn_site_parameters: ~azure.mgmt.network.v2020_07_01.models.VpnSite + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_07_01.models.VpnSite] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + vpn_site_parameters=vpn_site_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + vpn_site_parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.VpnSite" + """Updates VpnSite tags. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being updated. + :type vpn_site_name: str + :param vpn_site_parameters: Parameters supplied to update VpnSite tags. + :type vpn_site_parameters: ~azure.mgmt.network.v2020_07_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VpnSite, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VpnSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VpnSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vpn_site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a VpnSite. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :param vpn_site_name: The name of the VpnSite being deleted. + :type vpn_site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + vpn_site_name=vpn_site_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vpnSiteName': self._serialize.url("vpn_site_name", vpn_site_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnSitesResult"] + """Lists all the vpnSites in a resource group. + + :param resource_group_name: The resource group name of the VpnSite. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSitesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSitesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListVpnSitesResult"] + """Lists all the VpnSites in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListVpnSitesResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListVpnSitesResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListVpnSitesResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_web_application_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_web_application_firewall_policies_operations.py new file mode 100644 index 0000000000000..22fb2da3440df --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_web_application_firewall_policies_operations.py @@ -0,0 +1,426 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebApplicationFirewallPoliciesOperations(object): + """WebApplicationFirewallPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] + """Lists all of the protection policies within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebApplicationFirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebApplicationFirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies'} # type: ignore + + def list_all( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebApplicationFirewallPolicyListResult"] + """Gets all the WAF policies in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebApplicationFirewallPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebApplicationFirewallPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebApplicationFirewallPolicy" + """Retrieve protection policy with specified name within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the policy. + :type policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebApplicationFirewallPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebApplicationFirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + policy_name, # type: str + parameters, # type: "_models.WebApplicationFirewallPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.WebApplicationFirewallPolicy" + """Creates or update policy with specified rule set name within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the policy. + :type policy_name: str + :param parameters: Policy to be created. + :type parameters: ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebApplicationFirewallPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebApplicationFirewallPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebApplicationFirewallPolicy', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('WebApplicationFirewallPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes Policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param policy_name: The name of the policy. + :type policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + policy_name=policy_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'policyName': self._serialize.url("policy_name", policy_name, 'str', max_length=128, min_length=0), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_web_categories_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_web_categories_operations.py new file mode 100644 index 0000000000000..b18a5fbdaa4c8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_web_categories_operations.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebCategoriesOperations(object): + """WebCategoriesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.network.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureWebCategory" + """Gets the specified Azure Web Category. + + :param name: The name of the azureWebCategory. + :type name: str + :param expand: Expands resourceIds back referenced by the azureWebCategory resource. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureWebCategory, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_07_01.models.AzureWebCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureWebCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureWebCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AzureWebCategoryListResult"] + """Gets all the Azure Web Categories in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AzureWebCategoryListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_07_01.models.AzureWebCategoryListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureWebCategoryListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AzureWebCategoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/py.typed b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/py.typed new file mode 100644 index 0000000000000..e5aff4f83af86 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file